Image caption Carwyn Jones arriving for Labour's group meeting with Jane Hutt, who negotiated the deal

Carwyn Jones is set to be re-elected first minister after Labour and Plaid Cymru AMs backed a deal to end the week-long deadlock over the post.

The parties agreed to back the formation of a minority Labour Welsh Government.

They said it followed "constructive and positive talks" about "shared priorities for the coming assembly, and future working arrangements".

The assembly will reconvene on Wednesday to elect a first minister.

Both party groups met to discuss the proposals on Tuesday.

"We are pleased to confirm that the Welsh Labour and Plaid Cymru groups have today contacted the Presiding Officer in order to recall the Assembly tomorrow, and proceed with the nomination procedure for First Minister," the parties said in a joint statement on Tuesday, entitled Moving Wales Forward.

"This will allow the successful nomination of Carwyn Jones as First Minister, and the establishment of a Labour Minority Administration.

"This follows constructive and positive talks about the parties' shared priorities for the coming Assembly, and future working arrangements.

"The First Minister will set out tomorrow the next Government's intentions for the first 100 days, including a commitment to prioritise those areas that enjoy support from across most of the Assembly."

No M4 deal

Sources in Plaid and Labour say they have agreed a way for the two parties to exchange ideas and information.

There was no agreement between them on the contentious issue of the M4 relief road, but the sources said the parties had "agreed to progress what they could".

Media playback is unsupported on your device Media caption Conservative AM Paul Davies says it is 'disappointing' of Plaid to back Labour

Senior figures from Labour and Plaid Cymru held two days of talks after a Senedd vote was tied 29-29 last Wednesday on whether Mr Jones or Plaid leader Leanne Wood should be first minister.

UKIP and the Welsh Conservatives had backed Ms Wood, while Liberal Democrat AM Kirsty Williams supported Mr Jones.

The tied vote came after Labour fell short of a majority at the 5 May election, leaving it in need of opposition support to govern.

Welsh Conservative leader Andrew RT Davies accused Plaid Cymru of "locking themselves away and doing a cosy deal with their old friends in the Labour Party".

"Plaid Cymru have shown a distinct lack of appetite and ambition in exploring a new kind of collaborative politics," he said.

Leanne Wood, Plaid leader, said her party looks forward to offering "robust opposition over the next five years".

"The Conservatives failed to make a single gain, or to get a single manifesto commitment implemented during their time as the main opposition party in the last Assembly term. Perhaps that's why their seat share went down.

Image caption Plaid Cymru AMs held their group meeting in a committee room in Cardiff Bay

Lib Dem AM Kirsty Williams said: "I welcome the progress that seems to have been made to securing a successful nomination for First Minister tomorrow.

"For my part, I shall engage constructively with others, seeking to do the best for Wales based on Welsh Liberal Democrats policies and priorities."

David Rowlands

UKIP is intending to force a vote on the first minister nominations by putting one of their own ranks forward - although assembly sources say this can not be done under Senedd rules.

But it has emerged that the party plans to nominate neither its UKIP Wales leader Nathan Gill or UKIP Welsh Assembly group leader Neil Hamilton.

David Rowlands, an AM for South Wales East, is instead the intended nominee.

A source said: "If they put up Neil Hamilton he would have had four votes. That's the reality.

A spokesman for the UKIP group said: "It was Neil Hamilton's idea to put Nathan Gill forward, but then Nathan Gill recommended David Rowlands. Neil accepted his recommendation. There was never any consideration that it might be Neil."

On whether the plan could go ahead, the spokesman said: "The standing orders are not clear and they do not say there cannot be any more nominations. That will be up to the presiding officer however."