A rugby referee with a promising career ended up secretly living in a cupboard in UCD after his relationship broke down and he "lost control of his life", a court heard.
Paul Karugendo (29) had nowhere else to live when he stole a swipe card and began sleeping in a storage cupboard at the university.
He was arrested when staff caught him and he appeared in court on trespassing and theft charges.
Judge Michael Walsh adjourned his case for a probation report to be produced after hearing that Karugendo was back working as a referee for Leinster Rugby and had got his life back on track.
The accused, of no fixed address, pleaded guilty to trespassing, stealing a swipe card and handling a stolen master key at the UCD Science Building on March 5.
He also admitted trespassing on January 28, February 22 and a date unknown.
Garda Sergeant Gail Smith told Dublin District Court that in one of the earlier incidents the accused entered the university's science building as a trespasser using a stolen swipe card.
He was found in a boardroom in the early hours of the morning and gardai arrested him.
Karugendo made full admissions that he had trespassed on three occasions, Sgt Smith said.
On March 5, gardai attended an intruder call at the university at 1.45pm.
Security had carried out a search and found the accused in a locked boardroom.
He had a camera and charger and was arrested on suspicion of burglary.
He had no previous convictions of any kind and had been "totally co-operative" with the investigating garda, the court was told.
Karugendo had been living in one of the storage cupboards at the university, his solicitor Tracy Horan said.
He had previously trained at UCD and was familiar with the building.
The accused's relationship with his partner had broken down at the time and he had nowhere else to live, she added.
The court heard that the couple had had a baby and there had been "huge issues" between them over their financial means.
"It was a most difficult time for him, and he lost control of his life," Ms Horan said.
He was a man who "had a very promising rugby career" and had been working as a referee for Leinster.
He was considered a "great player", Ms Horan said.
Karugendo, who is originally from Uganda, knew the layout of UCD as he had trained there himself and got a swipe card and began staying there at night as a trespasser, Ms Horan said.
He was in a "deep depression" at the time.
He had pulled himself out of that depression, had been given a mentor and things had "turned around for him".
Karugendo was working for Leinster again and had his life back on track, Ms Horan said.
Judge Walsh adjourned the case to November 7.
He said he wanted a probation report to give "some insight" into the accused's background.
He said that, although Karugendo had no previous convictions, there were charges in relation to "a number of incidents" before the court.
He did not indicate the likely penalty.
The defendant, who did not address the court, was remanded on continuing bail.