(Adds comments by Biden in paragraphs 22-23)
* Premier seeks Sunni, Kurdish support against Islamic State
* Two Sunni leaders pull out of government talks
* Islamic State will remain threat with Syrian havens - U.S.
By Raheem Salman and Alexander Dziadosz
BAGHDAD, Aug 22 (Reuters) - Iraqi Shi'ite militiamen machine gunned minority Sunni Muslims in a village mosque on Friday, killing dozens just as Baghdad was trying to build a cross-community government to fight Sunni militants whose rise has alarmed Western powers.
A morgue official in Diyala province north of Baghdad said 68 people had been killed in the sectarian attack staged on the Muslim day of prayer. Ambulances took the bodies 60 km (40 miles) to the provincial capital of Baquba, where Iranian-trained Shi'ite militias are powerful and act with impunity.
Attacks on mosques are acutely sensitive and have in the past unleashed a deadly series of revenge killings and counter attacks in Iraq, where violence has returned to the levels of 2006-2007, the peak of a sectarian civil war.
Two influential Sunni politicians, Deputy Prime Minister Saleh al-Mutlaq and Parliament Speaker Salim al-Jibouri, quickly suspended participation in talks with the main Shi'ite political alliance to form a new government.
Lawmaker Nahida al-Dayani, who is from Diyala, said about 150 worshippers were at Imam Wais mosque when the militiamen arrived following a roadside bombing which had targeted a security vehicle. "It is a new massacre," said Dayani, a Sunni originally from the village where the attack happened.
"Sectarian militias entered and opened fire at worshippers. Most mosques have no security," she told Reuters. "Some of the victims were from one family. Some women who rushed to see the fate of their relatives at the mosque were killed."
The bloodbath marks a setback for Prime Minister-designate Haider al-Abadi, from the majority Shi'ite community, who is seeking support from Sunnis and ethnic Kurds to take on the Islamic State insurgency threatening to tear Iraq apart.
An army major who declined to be identified said the gunmen arrived in two pickup trucks after two bombs had gone off at the house of a Shi'ite militia leader, killing three of his men.
A Sunni tribal leader, Salman al-Jibouri, said his community was prepared to respond in kind. "Sunni tribes have been alerted to avenge the killings," he said.
In the northern city of Mosul, Islamic State, which this week released a video showing the beheading of American journalist James Foley, stoned a man to death after one of its self-appointed courts sentenced him for adultery, witnesses said.
The parents of Foley, who was kidnapped while covering the Syrian civil war, called on Friday for support to free other foreigners still held by Islamic State fighters.
"We do pray, we beg the international community to help the remaining hostages," Diane Foley said on MSNBC television. "We just pray that they will be set free," she said after a long conversation with Pope Francis, who the Vatican said called the couple on Thursday afternoon to offer his condolences.
Abadi, Iraq's prime minister-designate, condemned Foley's killing on his Facebook page and said Iraq would lead the fight against Islamic State with the help of Washington and other allies.
"The barbaric murder of journalist James Foley demonstrates to the world the lethal mindset and impending threat of ISIS & why they must be eradicated," he wrote.
The U.N. Security Council also condemned Foley's killing, saying Islamic State militants and their ideology of intolerance must be defeated.
The stoning, which happened on Thursday, was the first known instance of the punishment by Islamic State militants in Iraq since it seized large areas of the country in a June offensive. Having poured in from Syria across a desert border that it does not recognise, the movement has declared its own caliphate.
Similar stonings by the radical Sunni group have been previously reported in Syria, where it split from al Qaeda. Islamic State is the most powerful rebel group fighting President Bashar al-Assad's forces in a civil war which the United Nations said has claimed almost 200,000 lives at the very least.
U.S. President Barack Obama's decision to authorise air strikes in Iraq for the first time since American troops pulled out in 2011 has helped to slow the militants' offensive.
However, America's top soldier acknowledged that the internationally recognised frontier between Iraq and Syria, over which the militants have free passage, no longer meant much in the wider conflict.
General Martin Dempsey, chairman of the Joint Chiefs of Staff, suggested Islamic State would remain a danger until it could no longer count on safe havens in Syria.
The White House said on Friday the United States stood ready to take further action against Islamic State fighters and reiterated that it would not be restricted by the Iraq-Syria border. Deputy national security adviser Ben Rhodes said the group is more dangerous today than it was six months ago.
In an article in the Washington Post on Friday, U.S. Vice President Joe Biden said the advances made by the forces of the Iraqi government and Kurdish fighters against Islamic State showed that "when its fighting strength is eroded, it can be routed by local forces without U.S. boots on the ground."
He said it was critical for Iraqis to set aside their differences and form a government. "We are also encouraging Iraq's neighbours to refrain from fueling sectarian divisions," which only plays into Islamic State's hands, Biden said. He did not single out any of the neighbours, which include Shi'ite Iran and Sunni Saudi Arabia.
SYRIAN DEATH TOLL DOUBLES
Obama came close to ordering air strikes on Syria last year, but they would have been against Assad's forces which are fighting Islamic State in the complex war involving a range of factions battling each other.
At least 191,369 people have been killed in the Syrian conflict up to April, more than double the figure documented a year ago and probably still an underestimate, the United Nations human rights office said on Friday.
Obama had intended to punish Assad for using chemical weapons in the civil war - charges Damascus denied - but the air strikes were cancelled after a Russian-brokered deal under which Syria surrendered its chemical arsenal.
Sources familiar with Syrian government thinking say Assad is wagering that Islamic State's push to reshape the Middle East will eventually force a hostile West to deal with him as the only way to tackle the threat.
Western governments which back the uprising have dismissed the idea of rapprochement. But if the United States were to attack Islamic State in Syria, it would find itself - however reluctantly - fighting a common enemy with Assad.
British Foreign Secretary Philip Hammond said dialogue with Assad would not advance the Western cause. "We may very well find that on some occasions we are fighting the same people as he is but that doesn't make us his ally and ... it wouldn't be practical, sensible or helpful to even think about going down that route," Hammond told BBC Radio.
His Dutch counterpart Frans Timmermans said the fight against Islamic State could be successful only if it was confronted in Syria as well as Iraq.
Iraq also faces hard decisions. The government has promised to release from prison a former defence minister of ousted president Saddam Hussein, a senior Sunni official said.
In an interview with the London-based Asharq al-Awsat newspaper, Deputy Prime Minister Mutlaq did not say why the promises to free Sultan Hashem and other Sunni military and political leaders had been made.
Hashem's release could appease the Sunnis who dominated Iraq until a U.S.-led invasion overthrew Saddam in 2003.
But it would mark a major concession by the government led by Shi'ites and probably upset the Kurdish community. Hashem was sentenced to death for a campaign under Saddam that included gassing Kurds in the town of Halabja in 1988.
The conflict may also mean other old enemies working together, albeit with hard bargains being struck. This includes regional Shi'ite power Iran, which has long been at odds with the United States over its nuclear programme.
Foreign Minister Javad Zarif was quoted on Thursday by the state news agency IRNA as saying Tehran was ready to help tackle Islamic State in Iraq, but first wanted progress in negotiations with world powers over the nuclear programme.
However, perhaps reflecting the sensitivity of the issue, IRNA later reported foreign ministry spokeswoman Marzieh Afkham as dismissing "reports by some news agencies about Iran and U.S. cooperation in Iraq".
France, one of the six nations in nuclear talks with Tehran, said this week it wanted Arab states, Iran and the five permanent members of the U.N. Security Council to coordinate a comprehensive response against Islamic State.
The West fears the programme aims to develop a nuclear weapons capability, while Iran insists it is peaceful. (Reporting by Raheem Salman and Alexander Dziadosz; Additional reporting by Michael Georgy in Baghdad, Stephanie Nebehay in Geneva, William Maclean and Michelle Moghtader in Dubai, John Irish in Paris, Anthony Deutsch and Thomas Escritt in Amsterdam, Belinda Goldsmith in London, James Mackenzie in Rome and Susan Heavey in Washington; Writing by David Stamp; Editing by Alastair Macdonald, Howard Goller, Eric Beech and Mohammad Zargham)