Image copyright Getty Images Image caption Carwyn Jones and Leanne Wood had tied in a vote for first minister after the 2016 election

Plaid Cymru has ended its "compact" co-operation agreement with Labour.

It comes just days after the two parties agreed a deal to ensure Labour's budgets for this year and next would be passed by the assembly.

In a letter to Plaid members, leader Leanne Wood said the budget deal "represents a natural conclusion to the Compact".

First Minister Carwyn Jones said both sides were "amicable" and had agreed to "keep open lines of communication".

The compact had allowed Mr Jones to return to power after the 2016 assembly election.

Referring to the budget, Ms Wood said in her letter: "The two-year deal takes us to a position where we can produce a clear alternative in advance of the next Assembly elections.

"The commitments we have secured represent the green shoots of our programme for government. We must all work towards the goal of government if we are to see these foundations built upon."

Media playback is unsupported on your device Media caption Leanne Wood said people may have been confused about Plaid's stance on opposing Labour

She told BBC Wales that "some people might have been confused around where we stand in terms of opposition".

"This way now, it will be much clearer and cleaner for people to understand what Plaid Cymru's job of work is," she said.

'Stability'

In response, Mr Jones said: "Our conversation was amicable and we agreed that it was important to keep open lines of communication."

"From our viewpoint we believe the compact gave Wales some welcome stability at a time of great uncertainty caused by ongoing Tory cuts and the Brexit chaos in Westminster," he added.

In a tweet, Plaid Cymru AM Adam Price said the decision to end the compact had been made "before the summer".

Media playback is unsupported on your device Media caption Andrew RT Davies said it is still business as usual for Plaid and Labour

Welsh Conservative leader Andrew RT Davies said: "People across Wales will see straight through this duplicity.

"By continuing to support Welsh Labour's budget in the absence of an agreement shows Plaid's support has never been cheaper," he said.

UKIP called on Plaid Cymru to join with it in a vote of no confidence in the Welsh Government.

"The question now is whether Plaid will stand up and prove they are a real opposition," UKIP assembly group leader Neil Hamilton said.

The post-election agreement in 2016 had been struck a week after the Senedd was deadlocked in a tied vote between Mr Jones and Ms Wood for the job of first minister.

The end of the compact will not bring down the Welsh Government.

Although Labour is two seats short of a majority in the assembly, it has the support of Lib Dem AM Kirsty Williams - who is a cabinet secretary - and independent AM Dafydd Elis-Thomas.

This gives the Welsh Government an effective majority of 31 of the 60 seats.

Analysis by David Deans, BBC News

Before Friday it was pretty difficult for Plaid Cymru to argue that it was an opposition party preparing for government when it was in a co-operation agreement with the very party it wanted to unseat.

Today's announcement is more about the kind of party Plaid Cymru wants to be - although it's still tricky given the two-year budget deal - rather than the raw reality of how Wales is governed now.

It makes life uncomfortable for Carwyn Jones - who has a working majority of two - but not impossible.

And it hands former Plaid Cymru leader Lord Elis-Thomas a leverage he did not have before the compact was scrapped.