By Adrian Browne
BBC Wales political reporter
The housing dispute has exposed tensions between AMs and MPs
The assembly government has backed down in a dispute with Westminster over further powers it is seeking to provide a bigger stock of affordable homes.
The power to end tenants' right to buy council homes will be devolved but the Welsh secretary will have a veto on the matter, which is unprecedented.
The assembly government wants the flexibility to suspend the right to buy in areas of acute housing shortage.
But MPs were worried a future assembly could abolish the whole scheme.
Welsh Liberal Democrat leader Kirsty Williams said it was an "embarrassing climb down" for Plaid Cymru, Labour's coalition partners, and set "a very dangerous precedent for our future Welsh laws".
Plaid Cymru housing minister Jocelyn Davies conceded: "I'm afraid in the end, we've had to compromise".
Ms Davies said the decision came after eighteen months of work on acquiring the powers and the assembly government had "no intention to abolish the right to buy" anyway.
Welsh ministers had put forward a request to Westminster to give Cardiff Bay full powers over the right to buy scheme.
The Legislative Competence Order (LCO), which would transfer the powers, was approved by Whitehall departments, a committee of AMs and publicly endorsed by Ms Davies.
But MPs on the Welsh Affairs Select Committee then issued a report saying the assembly should not get the powers because they were much wider than were required.
AMs, including Presiding Officer Dafydd Elis-Thomas, said the LCO should not be redrafted as the MPs do not have the formal right to insist that orders are rewritten.
This put Welsh Secretary Paul Murphy in a difficult position, as he has to agree LCOs with the assembly government before they can be formally laid and passed by the assembly and parliament.
BBC Wales revealed late last year that First Minister Rhodri Morgan had agreed with Mr Murphy that the LCO should be redrawn to be narrower in scope.
But now, rather than narrowing the order, a clause has been inserted meaning that any future assembly government wanting to abolish the right to buy could not do so without the agreement of the Welsh secretary of the day.
Until now, when powers have been devolved, the assembly has been able to use them as it wishes.
This announcement could set a precedent for Westminster to be given vetoes in policy areas AMs are responsible for.
Alun Michael believes a sensible compromise has now been reached
It could mean, for example, that MPs might argue that if powers over the Welsh language were devolved to Cardiff Bay, the secretary of state for Wales should retain a veto to prevent a future assembly government legislating to make businesses treat Welsh and English equally.
Ms Williams described the decision on the affordable housing LCO as "totally unacceptable".
"Clearly, this is not about looking out for the people of Wales and the 87,000 households on housing waiting lists, this is Labour looking after their own interests and putting the brakes on devolution," she said.
"Why give us the full powers and then dictate from London what we can and cannot do with them?"
But Ms Davies denied that a precedent had necessarily been set to give the Welsh secretary further vetoes, thus restricting Cardiff Bay's room for manoeuvre.
She maintained: "The system is a Westminster system and this (assembly) government is campaigning and will be campaigning for the successful outcome to a referendum for a proper parliament.
"As the Welsh Assembly Government had no intention to abolish the right to buy I did feel that if a future government wanted to do that then they would have to seek the agreement of the secretary of state.
"But at least I'm able to deal with the One Wales (Plaid-Labour coalition agreement) promise of bringing forward legislation to allow the temporary suspension of right to buy".
Former Welsh secretary and assembly first secretary Alun Michael welcomed the compromise as "a sensible attempt to square the circle".
"One question that should be addressed is whether it should be the secretary of state that would have the right of veto, or whether it should be a parliamentary decision, then it could be a cross-party decision, but I'm sure these are all matters that will be discussed," he said.
"I think this has been a good process all round, and a good example of the Welsh Assembly Government and the Wales Office working together to resolve the issues that were raised during the committee hearing".