Labour peer and MSP Mike Watson has pleaded guilty to deliberately starting a fire and endangering life at an Edinburgh hotel last year.
Mike Watson and his wife Clare leave Edinburgh Sheriff Court
The Glasgow Cathcart MSP had been drinking and set fire to curtains at the Prestonfield Hotel in November.
A not guilty plea to a second fire-raising charge was accepted at the city's sheriff court.
Sentence has been deferred for three weeks. Watson, 56, said he intended to resign from the Scottish Parliament.
Accompanied by his wife Clare, Watson left the court without speaking to journalists.
However, his spokesman, Malcolm Brown, told reporters: "He fully recognises that his inexplicable actions on that evening, which were totally out of character, have caused great distress to a number of people.
"However, Mr Watson, in taking full responsibility for his actions, realises that he can no longer represent the people of Cathcart as an MSP and will be tendering his resignation.
"Mr Watson has also confirmed that he is to resign as a director of Dundee United Football Club."
Watson's spokesman said he offered his "sincere apologies" to all those affected.
Watson was charged following an incident at the Scottish Politician of the Year awards dinner on 12 November last year.
A curtain in a reception area was set on fire and closed circuit television pictures made available to the court showed flames climbing up the curtain and the room filling with smoke.
Hotel staff acted quickly and managed to extinguish the blaze.
Fiscal Adrian Fraser, prosecuting, told Sheriff Katherine Mackie that Watson had acted in a "hostile manner" towards staff.
Watson was attending an awards ceremony at the venue
Mr Fraser said that after the awards ceremony, Watson was invited to a private VIP party for about 100. He was very drunk and acting bizarrely.
He wandered around the hotel staring out of dark windows, asked for directions to a cloak room although he had no coat ticket and then became rude and aggressive to staff.
As staff cleared up a bar area the politician demanded more drink.
"He was seen to approach bar staff and was rude to them asking forcefully for more wine," Mr Fraser said.
When staff said the bar was closed he "continued to forcefully request more alcohol".
To calm him down, staff handed over an open bottle of wine.
"About 10 to 15 minutes later the fire alarm activated," Mr Fraser said.
CCTV footage shown to the court and watched by Lord Watson and his wife showed the MSP walk into a small reception area and use a torch to inspect the curtains.
He was seen lingering in the area for several minutes before putting something in his sporran and leaving. Watson was later found with matches that he tried to hide.
Mr Fraser said the damage caused by the fire was estimated at £4,500.
Fire expert James Wood told prosecutors that hotel occupants had been placed in "a potentially dangerous situation".
Mike Watson set fire to curtains at the hotel last year
Defence solicitor Paul Burns said his client had "drunk more than was wise" but his actions could not be explained purely in those terms.
He told the court: "There is a price to be paid for the pressures of public life and, like many persons in public life, there are sadnesses and disappointments in Mr Watson's private life that I suspect go some long way to explaining the sad chain of events that bring us here.
"The events of this night are as incomprehensible to Mr Watson as they must be to the many people who have looked at them and puzzled over them.
"The plea that is tendered by Mr Watson today acknowledges that it would be inappropriate for him to continue as a member of the Scottish Parliament and he has accordingly intimated to the clerk his intention to demit office."
Watson will be sentenced on 22 September.
His resignation means a by-election in the Glasgow Cathcart constituency, with a date yet to be fixed.