A priest felt "ashamed and disgusted" with himself after he had sex with a Polish student whose body was later found in his church, a court has heard.
Father Gerry Nugent also admitted in court to being an alcoholic
Father Gerry Nugent, 63, said he had a sexual relationship with Angelika Kluk in Glasgow in August or September 2005.
The 23-year-old's body was found under the floor of St Patrick's Church in Anderston, in September 2006.
Peter Tobin, 60, denies murdering Miss Kluk and hiding her body. The trial at the High Court in Edinburgh continues.
Father Nugent admitted he had abused the position of trust he was in.
He said sexual intimacy between the two happened "about three or four times" but he denied being in love with Ms Kluk.
Questioned by Dorothy Bain QC, prosecuting, he said: "I felt shame. I was disgusted at myself. I knew I was wrong and I wanted to make it right.
"I knew I was doing wrong and I was guilty.
"I felt terrible and I knew it had to stop so that part of the relationship stopped."
He added "I felt peace within myself when it was over. I still had the same feelings for her in terms of admiration and in my opinion the relationship was better because I was aware nothing was going wrong."
Angelika's body was found under the floor of the church
The court heard he went on to visit Miss Kluk in Poland in February 2006.
Father Nugent also admitted to being an alcoholic.
He said he went to Alcoholics Anonymous 10 years ago and discovered then that he had the illness.
The priest said he last saw Ms Kluk on Sunday 24 September, last year, in the garage of the chapel house with Mr Tobin, who was working as a handyman at the church.
Mr Tobin - known to Father Nugent as Pat McLaughlin - was building a shed and Ms Kluk was helping paint it.
Ms Bain read Father Nugent part of a statement he had given to the police in which he said: "At about 2.30 that afternoon I popped into the garage and saw Pat and Angela.
"Pat said to me he was getting great help from his apprentice."
The priest also described the night Angelika's lover Martin MacAskill and her sister Aneta called in police after the student's disappearance.
He said he went to his room in the chapel house to pray.
"I was not dealing with the situation very well," he said.
"I was just round the bend with the whole thing."
Father Nugent recounted Mr Tobin's conversation with the first police officers on the scene.
Mr Tobin had said someone had come to collect Angelika and that she had gone to play golf.
"He said she was going out and whoever she was going out with had a nice car," the priest said.
Father Nugent also told the court that he never got to bed that night and that it was the last time he saw Mr Tobin.
"After the mass the next morning, several times that morning, I phoned Pat's number because I was getting worried about him," he said.
"I wondered if it had been getting too much the night before.
"He never came back at all."
The charge against Mr Tobin alleges that between 24 and 29 September he raped and murdered Ms Kluk then hid the body under the floor of the church.
He denies all charges against him.
In a special defence Mr Tobin has admitted having sex with the Polish student, with her consent.
The trial continues.