Image copyright Getty Images Image caption Theresa May said it was a "matter of deep regret to me that I have not been able to deliver Brexit"

Theresa May had an "almost impossible job" as prime minister, former Welsh secretary Stephen Crabb has said.

Leading Welsh Conservatives have paid tribute to Mrs May after she announced the timetable for her departure.

Paul Davies, assembly Tory leader, praised her "tremendous achievement" in serving as the second female PM.

But Welsh Labour leader Mark Drakeford warned a Tory leadership contest "is the last thing the country needs".

Mrs May said it would always be a matter of "deep regret" to her that she was not able to deliver Brexit.

Mr Crabb, MP for Preseli Pembrokeshire, told BBC Wales he felt "genuinely sorry for someone I respected and stood by".

He said it was "really important" there was a swift leadership contest. "It doesn't need to be bitter," he said.

Any potential contender needs a "serious plan for Brexit," he said, warning slogans "aren't going to work". No deal is not a clear plan, he added.

Mrs May will quit on 7 June and a leadership contest will start the week after. A new PM will be in post by July.

Alun Cairns, Conservative Welsh Secretary, said Mrs May's statement was "dignified and powerful".

Skip Twitter post by @AlunCairns Dignified and powerful statement from @theresa_may. I have seen at first hand throughout her time as PM her ongoing support and absolute commitment to a prosperous Wales - a true public servant. — Alun Cairns (@AlunCairns) May 24, 2019 Report

Pro-Brexit Tory MP David Jones said it was "very distressing" to see someone go in such circumstances, but the resignation would be a "great relief" to the Conservative party.

The former Welsh secretary was the first Welsh Conservative MP to indicate who they would back in the leadership contest - confirming he would support Boris Johnson for the leadership.

"Clearly we do need a figure who is recognisable in the country at large, but who is also able to take the debate and the argument to people like Nigel Farage," the Clwyd West MP said.

Analysis

By Felicity Evans, BBC Wales political editor

Media playback is unsupported on your device Media caption The prime minister said the failure to deliver Brexit was a matter of "deep regret"

Does this make a no-deal exit from the EU more likely - an outcome which the Welsh Government and Alun Cairns, the Welsh Secretary, have both said will be very bad for the Welsh economy?

The clock is ticking down to our next scheduled departure date from the EU, 31 October.

If the new PM isn't in post until July, and the summer recess means no Parliamentary action in August, the window for achieving any sort of agreement is extremely tight.

Will the EU give us another extension and would the new prime minister want their leadership to begin with having to look like a supplicant asking the EU for a favour.

A lot of promises will be made, and assurances given, over the next few weeks, but whoever ends up with the job, in this most fractious of parliaments will find delivering on them a challenge.

Image caption Mark Drakeford said Theresa May lacked basic political skills

Mr Cairns denied that a no-deal Brexit was more likely. "Negotiations and discussions don't stop during the summer recess," he said.

"By standing aside earlier than planned the prime minister put the national interest first."

Mark Drakeford said the PM had lacked "basic political skills".

He said: "The prime minister started off in the wrong way; she had a winner takes all approach. She acted as if the 52% who voted to leave counted for everything and the 48% who voted to stay counted for nothing - hence the red lines, hence the way she went about the negotiations."

Skip Twitter post by @SCrabbPembs Thank you @theresa_may for your dedication and incredibly hard efforts on behalf of this deeply divided country. Almost impossible job in the current climate. Very best wishes. — Stephen Crabb (@SCrabbPembs) May 24, 2019 Report

David Davies, the Monmouth Conservative MP and a Brexit campaigner, said: "We have failed. The Conservative party has failed.

"We said we were going to deliver Brexit by the end of March and we have failed."

Paul Davies thanked the PM for her "dedication and commitment to Wales". "The party must now come together and deliver the Brexit that people voted for," he said.

Media playback is unsupported on your device Media caption Theresa May: How the PM fought through Brexit battles

Plaid Cymru leader Adam Price said Mrs May's speech showed "her commitment to doing what she believed was right".

But he added: "Sticking rigidly by her red lines, Mrs May ignored the interests of Wales and millions across the UK who felt alienated by her approach to Brexit, as summed up in her 'no deal is better than a bad deal' catchphrase."

Brexiteers outside of the Conservatives were even harsher about Mrs May's legacy. Brexit Party Senedd leader Mark Reckless, who was a member of the assembly's Tory group until last week, said: "I supported May, when she came to office, as she pledged to take us out of the Single Market, Customs Union and European Court of Justice.

"As she leaves office, none of these things have happened. She has lied and lied and lied again."

Bridgend Labour AM Carwyn Jones was first minister when Theresa May took office in 2016. "She tried to broker a compromise at a time when society is so polarised," he said.

"She tried to bring together sides that, at the end of the day, opposed each other so much it was impossible to get any kind of middle ground."

Theresa May in Wales

By David Deans, BBC Wales

Image copyright Getty Images Image caption A Theresa May visit to Wales was the scene of a disastrous campaign episode

It was in Wales in 2017 where Theresa May famously decided to call a snap general election, while on a walking holiday to Snowdonia.

After an opinion poll put the party in the lead, and Mrs May kicked-off the Welsh Conservative campaign on the doorstep of the former first minister Carwyn Jones in Bridgend, there were hopes of major Tory gains.

It didn't work out. Wales was the scene of a disastrous campaign episode in Gresford, near Wrexham, where the PM struggled to explain how a change to a English social-care policy was not a U-turn.

Come polling day, the party went into reverse. It lost its majority and in Wales lost three seats, including prized Cameron-era gains in Vale of Clwyd and Gower.

What has May's government meant for Wales? Critics will point to infrastructure projects abandoned - the Swansea Bay Tidal Lagoon, and railway electrification beyond Cardiff.

Supporters will praise her for lifting the tolls on the Severn Bridges, and for pushing ahead with regional funding packages like the Swansea Bay city deal.