Shadow Home Secretary Diane Abbott has apologised after a photo emerged of her sipping a can of M&S mojito on a London Overground train.
Since 1 June 2008 it has been illegal to drink alcohol on Transport for London's (TfL) network.
The Hackney North and Stoke Newington MP said she was "sincerely sorry for drinking on TfL".
Under TfL's conditions of carriage "anyone caught consuming alcohol may be prosecuted".
Ms Abbott said she was "sincerely sorry" for drinking the tinned cocktail.
She wrote on Twitter: "A photo of me drinking from a can of M&S mojito on the Overground has been circulated.
"I'm sincerely sorry for drinking on TFL."
A photo of me drinking from a can of M&S mojito on the Overground has been circulated. I'm sincerely sorry for drinking on TFL.— Diane Abbott (@HackneyAbbott) April 19, 2019
Ms Abbott, who previously campaigned to end the sale of cheap alcohol, received several supportive messages in reply to her tweet.
One Twitter user wrote: "I'm sincerely sorry you feel the need to say sorry Dianne and i hope you really enjoyed the drink it's no one's business but yours."
Another said: "Put it in a water bottle next time."
The alcohol ban was introduced by the then Mayor of London, Boris Johnson, in an attempt to tackle unruly behaviour on the TfL network.
It was described by union leaders as "half-baked".
On 31 May 2008 - a day before the alcohol ban came into place - revellers enjoyed a "cocktail party" on parts of the London Underground, mainly on the Circle Line.
Within the first five months of the ban being enforced, a BBC investigation found that British Transport Police spoke to 35 people who had been seen drinking alcohol on the Tube.
However, none of those incidents was recorded as a criminal offence.