Welsh Labour leaders have rubbished claims that they could consider a deal with Plaid Cymru if they fail to win a majority in the assembly election.
Senior Labour sources have told BBC Wales the party may try to work with Plaid, but without a formal coalition.
Welsh Labour leader Rhodri Morgan said: "Neither I nor anyone else acting with my authority has been engaged in any such considerations or discussions."
Plaid said it would not "prop up a failing Labour administration".
The Labour leaders reacted after party sources accused Liberal Democrats of "posturing and assuming they have an automatic right to be in government".
In 2000, Labour and the Lib Dems formed a coalition administration in Cardiff Bay. It lasted until the 2003 election, when Labour won a bare majority, with 30 of the 60 seats.
Labour later lost that majority, but continued to rule as a minority administration without bringing the Lib Dems back into government.
Many in Labour see the Lib Dems as natural coalition partners, and the pair have a similar partnership in the Scottish Parliament.
But BBC Wales understands that, while some senior Labour politicians believe a formal coalition with Plaid is unlikely, they would be prepared to make major policy concessions in return for the party's support in votes of confidence and on issues such as the assembly budget.
However, party leaders issued angry denials of the BBC report.
Mr Morgan said: "Welsh Labour is aiming to form a government based on a mandate from the people of Wales".
Mr Hain said: "Labour Party members simply wouldn't wear a coalition with Plaid Cymru."
Plaid emphasised that it was seeking to play a lead role in a new assembly government, and would not "prop up a failing Labour administration".
Party leader Ieuan Wyn Jones said: "If no party gets an overall majority, we will talk to all the other parties if it is in the interest of Wales.
"However, we will not support a failing Labour government on an informal basis, propping up the shambles that we've seen over the past eight years."
Lib Dem campaign chair Jenny Willott said: "Labour are clearly in disarray. They are struggling to run a coherent campaign, much like their muddled management of Wales over the last four years.
"Whilst Plaid and Labour indulge in this clumsy courtship today through the media, we remain focused on the policies that matter.
"Spinning dodgy deals before the electorate have had their say is the refuge of desperate parties on the slide in this election."
A Conservative spokesman said: "It is becoming increasingly clear that Labour and Plaid are preparing to do a deal to keep Rhodri Morgan in office after 3 May.
"Labour will do anything to cling onto power for another four years. It seems Plaid Cymru could help them achieve that."
If such an arrangement went ahead it would mirror what happens in New Zealand, where the New Zealand Labour Party has a formal coalition with one other party and has done deals with three others to ensure that it does not lose any votes of confidence.
If Labour were to make such a deal, it would call into question one of the central tactics of its election campaign.
Labour has repeatedly claimed that Plaid was planning to go into a "Tory-led coalition" administration after the election - a claim Plaid has strenuously denied.
Over recent days, Plaid leader Ieuan Wyn Jones has refused to rule out either a deal with Labour or with the other parties should the election fail to produce a single outright winner.
But it is understood the party is not necessarily concerned about whether this includes having Plaid ministers in the cabinet.
BBC Wales understands that Plaid would demand major concessions from Labour at Westminster as well as in Cardiff Bay in return for its support, including a commitment to a rapid expansion in the assembly's powers.
There is a recent example of Plaid coming to the aid of the minority Labour administration on the budget.
Before Christmas, Plaid incurred the wrath of the other opposition parties when it broke ranks with them and did a deal to allow the Labour assembly government's budget to pass.
At the time the Plaid leader said he had won a "major concession" on school funding.
But if this new arrangement did go ahead after the election it could be the first long-term deal between the two parties since Plaid Cymru MPs helped keep Labour Prime Minister James Callaghan in Downing Street in the late 1970s.