The head of Spain's Madrid region has stepped down amid shoplifting allegations, weeks after being accused of faking a master's degree.

Cristina Cifuentes condemned as a personal attack the publication of a video from 2011 showing her handing items to a supermarket security guard.

It is claimed she had taken two pots of anti-ageing cream worth €40 (£35; $50).

Ms Cifuentes, 53, gave up her master's last week when it emerged that two signatures on the document were forged.

A prominent figure in Spain's ruling centre-right PP (Partido Popular), Ms Cifuentes had already come under pressure from political opponents to resign because of the degree affair.

She told a press conference on Wednesday that she had planned to announce her resignation next week but had brought it forward in response to the latest allegations.

Her resignation is a blow to Prime Minister Mariano Rajoy, whose party has faced a succession of corruption scandals. By stepping down she averted a motion of no confidence which she said would have brought Madrid under the control of the left-wing socialist and Podemos parties.

Mr Rajoy said the president of Madrid's regional government had done the right thing in stepping down.

Ms Cifuentes condemned the video that appeared on the OK Diario website on Wednesday as part of a "campaign of harassment aimed at bringing me down". At the time the video was recorded, she was number two in the Madrid assembly.

However, she went on to admit the recording was genuine.

"It was an involuntary mistake and it's being used to go beyond political issues, it's personal," she said. "I was already the target of blackmail two years ago for that video, but this time I tell you a red line has been crossed."