A civilian officer hurled a drunken "litany of abuse" at young soldiers the night before a private was found dead on a military base, an inquest heard.
Private Geoff Gray, from Seaham, was found with two gunshot wounds to his head on September 17 2001, after he had been on guard duty at Deepcut Barracks.
The family of the 17-year-old believe another recruit or recruits may have shot the teenager.
At a hearing at Woking Coroner's Court on Friday, then fire officer Billy Murphy admitted he was "drunk" on Sunday, September 16 after watching football at a local pub.
The inquest heard that on his late-evening return to the base where he lived, Mr Murphy was denied entry by a female soldier who was on guard at the entrance.
Counsel to the inquest confirmed to the Press Association that Private Gray was also on duty at the gate at the time.
The validity of Mr Murphy's civilian military ID was questioned and it took an intervention from other officers for him to enter.
"When I came to the gate and I was declined entry I became abusive, which I totally apologise for," Mr Murphy told the inquest.
He added: "The litany of abuse was out of order and I apologise for that again."
Mr Murphy said he was "quite upset" and accepted that "I was drunk".
John Cooper QC, for the Gray family, told the hearing that in Mr Murphy's statement to police in June 2002 he said he was only "merry" after leaving the pub.
Mr Murphy, who was 41 at the time of the incident, told the inquest: "I did tell a lie and I apologise for that, I don't tell lies in the plural sense.
"I admit I was economical with the truth."
In his 2002 statement, parts of which were read out by Mr Cooper, Mr Murphy said he was "shouting and swearing" at the guards, who he felt were discriminating against him because of his "thick Irish accent".
Asked if he had made "threats of violence" to the Privates, Mr Murphy said: "No sir, I am not a violent person."
He also rejected Mr Cooper's suggestion he was a "bully" and said he was "never angry at any time".
Mr Murphy explained he could not identify the Privates involved in the altercation because of light shining into his eyes.
Mr Cooper told the inquest that Mr Murphy was led back to his room by another civilian officer, Thomas McSeveney, whose own statement said he had to twice "remonstrate" with Mr Murphy, who wanted to return to the barracks reception.
Mr Murphy said he had "no idea" what happened to Private Gray, and had only left his room to go for breakfast in the morning, when he discovered a police presence on the base.
Nicholas Moss, counsel for the Ministry of Defence (MoD), added that another officer, then major Paul Duncan, said he checked on Mr Murphy that night after the shots were fired, finding him in his room.
Mr Moss told the inquest that Mr Murphy joined the MoD in 1979 and had been based at Deepcut since March 2000.
He said investigations by Surrey Police found that during Mr Murphy's career he had been reprimanded just once for a "minor breach of security" when he put his name and address on an envelope when he should not have.
In 2002 a coroner recorded an open verdict at the first inquest into the death of Private Gray, originally from County Durham.
The new inquest is taking place because former attorney general Jeremy Wright QC said he was satisfied fresh evidence had come to light.
Private Gray was one of four young soldiers to die at the Princess Royal Barracks, Deepcut, between 1995 and 2002 amid claims of bullying and abuse.
Privates Sean Benton, 20, Cheryl James, 18, and James Collinson, 17, also died from gunshot wounds at the base.
The inquest, which does not have a jury, is expected to hear from 91 witnesses and is listed to last until early May.