WASHINGTON — Security at the US Embassy in Baghdad was strengthened and some staff members sent elsewhere as Iraq was shaken with instability, the State Department said Sunday.

State Department spokeswoman Jen Psaki said in a statement that much of US Embassy staff will remain even as parts of the country experience instability and violence.

“Overall, a substantial majority of the US Embassy presence in Iraq will remain in place and the embassy will be fully equipped to carry out its national security mission,” she said.

Some embassy staff members have been temporarily moved elsewhere in Iraq and to Jordan, she said.

US travelers in the country were encouraged to exercise caution and limit travel to certain parts of Iraq.

Earlier Sunday, Sen. Lindsey Graham (R-SC) said Iraqi Prime Minister Nouri al-Maliki cannot keep his country together, and a US alliance with Iran might be needed to do so.

Graham, a member of the Armed Services Committee, said a US partnership with longtime foe Iran makes him uncomfortable, but likened it to the United States working with Josef Stalin in World War II against Adolf Hitler. He says the United States has to do what it can to keep Baghdad from falling to insurgents.

An al Qaeda splinter group surprised Western intelligence organizations last week and took control of major Iraqi cities. Iran says it has no interest in a destabilized Iraq as its neighbor.

Graham spoke to CNN’s “State of the Union” and CBS’ “Face the Nation.”