The Bush administration, caught out by the rise of Hamas, embarked on a secret project for the armed overthrow of the Islamist government in Gaza, it emerged yesterday.

Vanity Fair reports in its April edition that President George Bush and the secretary of state, Condoleezza Rice, signed off on a plan for the Palestinian president, Mahmoud Abbas, to remove the Hamas authorities in Gaza. The plan called for Washington's allies in the region to funnel arms and salaries to Fatah fighters who would lead a rising against Hamas.

But the project was controversial even within the administration, the magazine reports. "There were severe fissures among neoconservatives over this," David Wurmser, a former Middle East adviser to the vice-president, Dick Cheney, told the magazine. "We were ripping each other to pieces."

Wurmser resigned his post in the vice-president's office in July 2007, only weeks after bloody clashes in Gaza between Hamas and Fatah that led to the Islamist organisation taking total control of the territory. "It looks to me that what happened wasn't so much a coup by Hamas but an attempted coup by Fatah that was pre-empted before it could happen," he said.

The Bush administration plan sought to undo the results of elections in the West Bank and Gaza in January 2006 which, to the chagrin of White House and State Department officials, saw Hamas win a majority of seats in the Palestinian legislature.

The project was approved by Bush, Rice, and Elliott Abrams, the hawkish deputy national security adviser.

The 2006 election result was seen as an affront to the central premise of the Bush administration's policy in the Middle East - that democratic elections would inexorably lead to pro-western governments.

With the victory of Hamas, Rice moved swiftly to try to persuade Abbas to take steps to dissolve the Hamas authority in Gaza. When Abbas did not move quickly enough, the US consul general in Jerusalem, Jake Walles, was despatched to Ramallah to deliver a curt reminder.

The magazine quotes a memo for Walles's meeting with Hamas as saying: "You should make clear your intention to declare a state of emergency and form an emergency government."

The central man figure in Washington's plan was Mohammed Dahlan, who had been Yasser Arafat's security chief in Gaza and who had established close ties with the CIA as early as the 1990s. The magazine cites three unidentified US officials quoting Bush as saying: "He's our guy."

According to the magazine, Rice played a main role in trying to persuade Egypt, Jordan, Saudi Arabia and the United Arab Emirates to offer training and funding to the Fatah fighters. Israeli officials admitted in December 2006 that Egypt had sent weapons to the Fatah faction in Gaza.

The US effort did not end with the establishment of a Palestinian national unity government. Vanity Fair describes the administration's plan B, which called for adding 4,700 new Fatah troops with additional training in Jordan and Egypt.

A state department memo put the cost for salaries, training and weapons at $1.27bn (£640m) over five years.