The United States is preparing to open a direct dialogue with Iran about how to deal with the Sunni insurgency in Iraq, a senior official said on Sunday. Speaking on condition of anonymity, the official said the US was considering engaging with its longtime adversary about Iraq, where the government of prime minister Nuri al-Maliki is struggling to repel a militants who have seized several cities. The Wall Street Journal reported on Sunday that Washington was preparing to open talks with Iran on ways to push back the militants. Citing senior US officials, the newspaper said the dialogue was expected to begin this week. It comes as the US and other world powers strive for an agreement with Tehran to curb its nuclear program. Militants from the Isis group have swept through towns in the Tigris valley north of Baghdad in recent days but appeared to have halted their advance outside Baghdad as they tightened their grip on the north. Insurgents seized the mainly ethnic Turkmen town of Tal Afar in northwestern Iraq on Sunday after heavy fighting. Residents reached by telephone in the city of Tal Afar said it had fallen to the rebels after a battle that saw heavy casualties on both sides. "The city was overrun by militants. Severe fighting took place, and many people were killed. Shi'ite families have fled to the west and Sunni families have fled to the east," said a city official who asked not to be identified. US officials said it was not certain which diplomatic channel the Obama administration would use with Iran for any discussions about Iraq, the Journal reported. One possibility was through Vienna, the paper said, where senior US and Iranian officials were scheduled to meet with other world powers on Monday to negotiate Iran's nuclear program. The US state department said on Sunday that the number two American diplomat, deputy secretary of state Bill Burns, would travel to Vienna this week to take part in the talks. US senator Lindsey Graham said on Sunday that Washington needed Iran's involvement to prevent a government collapse in Iraq and should open talks with Tehran. "We are probably going to need their help to hold Baghdad," Graham, a South Carolina Republican, said on CBS' Face the Nation. Graham, a member of the Senate armed services Committee, said the idea was "unattractive" but compared it to the US working with the Soviet Union against Adolf Hitler.