The teenager charged with murdering Melanie McCarthy McNamara has admitted writing two letters in which the prosecution claims he bragged about shooting her.

Daniel McDonnell wrote the letters from his prison cell in March 2012, while on remand in St Patrick’s Institution after being charged with her murder.

Mr McDonnell (aged 19) of Brookview Lawns in Tallaght has pleaded not guilty to murdering 16-year-old Melanie on February 8, 2012, at nearby Brookview Way. She was shot in the head as she sat in a car with her boyfriend and his friend.

His trial at the Central Criminal Court has already heard details of letters, which he asked prison staff to post to two separate people.

His barrister, Patrick Marrinan SC, today told the jury that he was making a formal admission on his client’s behalf, which was to be taken as a statement of fact.

“While detained at St Patrick’s Institution, the accused admits that he wrote the two letters,” he said.

The court heard yesterday that one letter contained the words: “Close-range head shots. That’s what I’m going for… Two in the head. The bitch is dead. Ha ha… Little did he know I had a loaded 12-guage. Left his bitch all over the Sunday World front page… Best night of my poxy life.”

In the second letter, the accused wrote: “That other thing wouldn’t have happened if I’d known she was in the car. It was meant for that other smell bag. He won’t get away with bullying my Ma.”

The prison’s chief officer, Martin Kavanagh, testified that he handed the letters over to the gardaí.

He agreed with Mr Marrinan that his client was known to the institution’s staff to be one of the prisoners taking drugs.

He also agreed that Mr McDonnell was found to be in possession of eight litres of a home-made brew on one occasion.

The court also heard from some of the gardaí who had interviewed the accused following his arrest some weeks earlier.

Detective Garda Andrew Manning of the National Bureau of Criminal Investigation agreed with Mr Marrinan that he had suggested his client was stupid.

“It’s an awful thing to have on your conscience,” suggested Det. Gda Manning and a colleague.

“But, do you know what must be really bothering you? You ran out of petrol. How stupid is that?” they asked.

The trial has already heard that the Hyundai Santa Fe used in the shooting was found abandoned a short time later, having run out of fuel.

“You’ve left a trail that even Stevie Wonder could follow,” remarked the detectives.

“I’d say you’re as popular in West Tallaght as Bin Laden would be in New York,” they said later.

The detective also agreed that they later put specific allegations to him with a view to breaking him down.

“You are the gunman, Danny. You are the man, who blew the face off that poor child. Can you explain why you weren’t wearing balaclavas? Did you want to be recognised?” they asked.

“Did you want everyone in Brookview Way to know who carried out this assassination? Did you want to achieve some notoriety? You certainly did that,” they suggested.

Det. Gda Manning agreed that the accused replied: ‘No comment’ to each question and statement.

The trial continues before Mr Justice Paul Carney and a jury of six men and six women.