The top Republican presidential candidates are trying to out-tough each other on Iran, calling President Obama too weak and threatening to use force. The prospect of war with Iran is usually discussed in isolation from the war we are already fighting in Afghanistan. That’s a big mistake, taking on a second war before finishing the one you’re in is a recipe for two disasters.

One hundred and fifty years ago, the United States was engulfed in its Civil War when the threat of a second war with Britain and France developed in 1862. Secretary of State William Seward urged the cabinet to declare war on the European powers for tilting toward the Confederacy. Seward pressed for an invasion of Canada. President Abraham Lincoln disagreed and famously said to Seward “one war at a time, please.”

With so many politicians and pundits now calling for using military force to keep Iran from acquiring nuclear weapons, it is wise to heed Lincoln’s advice. The first Republican president’s advice, of course, was ignored by our last Republican president, George Bush, who took his eye off the ball in Afghanistan in 2002 and 2003 to invade Iraq. Resources needed to stabilize Afghanistan after a quarter century of war were deployed to Iraq, and Afghanistan was shortchanged. The result was the revival of al Qaeda in Pakistan and the resurrection of the Taliban in Afghanistan. The 2007 surge in Iraq only made a bad situation much worse. More troops were desperately needed in Afghanistan by 2007 to halt the Taliban’s momentum, instead they went to Iraq. By 2009 President Obama had inherited a disaster in Afghanistan because his predecessor had neglected the “forgotten” war he had started.

A new military operation in Iran today—while NATO is still heavily engaged in Afghanistan—will have the same effect, only worse. Intelligence-collection capabilities now being used to fight the Taliban and al Qaeda would be immediately diverted to dealing with Iranian threats. If a conflict with Iran escalated beyond airstrikes to a naval struggle in the Strait of Hormuz, more resources would be diverted. Some argue a war with Iran can be kept limited but history shows that wars are inherently unpredictable, and while we can decide alone how a war starts it takes two sides to determine how it ends.

Moreover, an American military operation against Iran would almost certainly prompt Iranian retaliation and Afghanistan, Obama’s war now, would be particularly attractive target for Iran. Today most of western Afghanistan is relatively stable, unlike the south and east, and is lightly manned by Italian and Spanish NATO forces. The largest city, Herat, is connected to the Iranian electrical grid and there is considerable cross-border trade. But Iran has been quietly building connections to the Taliban for the past few years. It could easily help the Taliban destabilize the west rapidly and offer it sanctuary in eastern Iran. It could turn off the lights in Herat and elsewhere. It could stretch already thin NATO forces beyond their capabilities. A very difficult war in Afghanistan would become even more difficult, if not impossible. More U.S. troops would be needed, throwing into jeopardy Obama’s plan to downsize the commitment.

Shia Iran and the Sunni Taliban are not natural allies, they came close to war in 1998, but they are likely to work together against America if pressed. An American or Israeli strike on Iranian nuclear facilities would facilitate their rapprochement as Tehran seeks vulnerable openings. Senior Italian officials, with some 4,000 troops on a 300 mile long border frontier with Iran outside Herat, have told me they are horrified at the idea of a war with Iran and would immediately need substantial reinforcement.

The Kabul government, our ally, would find itself in the middle between two friends. President Karzai and his government have never been comfortable with America’s Iran policy. Karzai has tried hard to build a cooperative relationship with Iran, in part to offset Pakistan’s support for the Taliban. With Indian help a new highway linking Afghanistan to the Arabian Sea through Iran was opened in 2009; now it may be followed by a railroad. For the first time in its modern history Afghanistan has an alternative outlet for exports to the sea other than Karachi, Pakistan. With the Pakistan border closed since November, the Iran outlet has become even more critical. The Karzai government could collapse if it had to choose between Tehran and Washington.

Pakistan will not be so conflicted. It will side with Iran at least rhetorically and diplomatically. It will see the American decision to go after Iranian nuclear sites as a clear warning that it could be next someday. Pakistan’s deeply anti-American population will side with their fellow Muslims next door and its equally anti-American generals will be determined to build even more bombs to deter any American adventure in their country. The fastest growing nuclear arsenal in the world will grow even faster.

Whether you support Obama’s policies in Afghanistan or not, we are there now and will have tens of thousands of troops in place at least through the election and probably well beyond. We should keep Lincoln’s advice in mind.