A Trowbridge teenager who robbed a man of 20 bottles of lager in a homophobic attack has been jailed for two years and nine months.

Nathan Ashton, who was with a 17-year-old accomplice, also took a wallet from his victim in the attack.

The court heard Ashton, 19, had also failed to do community service and probation imposed last year after he took part in a burglary on a pensioner's house.

Chris Jervis, prosecuting, said two men were near a bridge in Trowbridge shortly after 1pm on February 19 when the incident took place.

The men had just bought the 20 bottles of lager at Tesco when they were approached by Ashton, the 17-year-old, and a third man.

Mr Jervis said: "The 17-year-old started verbally abusing the man for being gay.

"He feared for his safety and was punched in the face by the 17-year-old causing a lot of pain.

"He was then stared at by this defendant and this defendant then asked him if he had any money on him. He said he hadn't. The 17-year-old then said 'In that case we'll take your beer' and did so.

"Ashton then searched the victim and took his wallet which contained credit and bank cards."

He said the third man has never been identified.

When the teenager first appeared before magistrates Ashton failed to turn up and the youngster was dealt with there in error, the court was told. He was sentenced to 50 hours' community service and a one-year probation order.

Mr Jervis said Ashton had been placed on a similar order in November last year after he admitted taking part in a burglary at a woman's house.

In that offence, committed with the victim's grandson, Ashton broke a window for his friend to get in and then kept watch.

He was sentenced to 100 hours' community service and an 18-month probation order but failed to do any of the work.

Ashton, of Brown Street, admitted robbery and breaching the community punishment and rehabilitation order.

Sarah Regan, defending, said Ashton knew he was heading for jail. She said: "Nathan is unable to say why he participated in this offence which was instigated by the other man.

"All he can say is he went along because he was bored and he was broke," she said.

Ashton's parent's split up last year and she said he had been estranged from his brother and sister as his step-mother felt he was a bad influence, she said.

Though he had worked for much of his time after leaving school she said he lost his job and motivation after the break up of the family.

Judge Mark Dyer said: "I accept you didn't yourself use violence or don't appear to have homophobic tendencies where your 17-year-old co-defendant has.

"Street robbery is something that has got to be put down by people being put in custody.

"As for the burglary, you were given a clear chance and you just threw it away. Just threw it away."