Maryland National Guard soldiers are among more than 2,000 troops amassing this holiday weekend to make final preparations to deploy to Iraq for the next 12 months.

Their mission has just one mathematical problem: As of now, all U.S. soldiers are supposed to leave Iraq in less than four months.

At the stroke of midnight on Dec. 31, U.S. soldiers will lose their legal protection to operate in the country. Despite general expectations among Americans that a deal for an extension will be struck, intractable Iraqi politics have left Shiites, Sunnis and Kurds unable to agree on if, and how many, U.S. soldiers might be asked to remain.

Tearful goodbyes, such as those last week at Aberdeen Proving Ground, are beginning to drive home for U.S. military families in the Washington region and beyond what until now has been a riddle of recondite Iraqi politics and international diplomacy. Soldiers and their families not only have no way of knowing how and when their tours will end, but they also have less certainty than at any point in recent memory about how dangerous their missions might become.

Radical Shiite groups have promised that any U.S. soldiers who remain in Iraq beyond this year will be targeted for new attacks. Even if Americans fully withdraw in advance of the Jan. 1 deadline, troops will be more exposed as they work to close bases and haul out of Iraq hundreds of thousands of pieces of equipment amassed over more than eight years of war.

“As soldiers, we go wherever we are told to go. We just follow orders — it makes it nice and simple,” said Maj. Gen. James A. Adkins, adjutant general of the Maryland National Guard. “The rest is up to the Department of State, the U.S. government, and the requirements and agreements with Iraq.”

A simple task, in theory, but not so much in practice.

As they boarded buses late last week for a flight to Fort Hood, Tex., their final stop before leaving for Iraq, many guardsmen acknowledged that what lies on the other side of Dec. 31 has become a growing concern.

Many of the more than 120 Maryland soldiers will be on their second or third tour to Iraq since 2004. Many are now married; others will leave behind children for the first time. Parents have grown older. Plus, the rough economy has left most fearful of what they may encounter when they return.

Capt. Harris Roscoe said he has told his men not to get bogged down by the uncertainty of what may happen either at home or for their unit after the year-end deadline.

“Our orders are for a 400-day mission. That’s what we’re going to do,” he said, referring to the total time the guardsmen have been told to prepare to be away for training, travel and deployment. “What happens on Dec. 31? After? I don’t know. I don’t know.”

In the days before this weekend’s deployment, Spec. Sara E. Bush of Salisbury was most concerned about another date: Sept. 26, the birthday for her 3-year-old son, Damion, that she will miss. “We had a big, early, pirate-themed birthday party,” she said. “It hasn’t hit me yet.”

The reality had set in for Staff Sgt. John Lane, 39. “It’s harder this time,” he said. “Much harder,” chimed in his wife, Nadine, as she clutched their 8-month-old son, Arian, and called to their 2-year-old daughter, Anais. The last time Lane deployed, to northern Iraq in 2007, the two were newlyweds.

“It was difficult, but it was just me and my wife,” said Lane, a Dell employee in Stafford. “We knew each other’s strengths and weaknesses. Having two kids creates a lot more emotion.” He added that he hopes this tour, which is expected to include more administrative duties, will bring better access to a computer and Skype to see his children.

The Lanes, like others, hugged, cried and, at the deployment ceremony last week, avoided the topic of how dangerous Iraq might become if their unit remains after Dec. 31.

The Maryland soldiers will deploy as part of the Headquarters Company of the 29th Combat Aviation Brigade. The unit, which is gathering to a full strength of nearly 2,000 this weekend at Fort Hood, will be made up of National Guard soldiers from more than a dozen states. It will be responsible for overseeing all Army aviation operations in Iraq, which still include everything from routine helicopter transports to air support for Iraqi military operations, and even medical evacuations for U.S. and Iraqi soldiers.

Lt. Col. Peggy Kageleiry, an Army spokeswoman at the Pentagon, said the 29th is one of four brigades of fresh soldiers still scheduled to rotate into Iraq before the end of the year. All units deploying between now and Dec. 31 plan to deploy for 12 months, she said in an e-mail.

“This strikes me as an effort to be better safe than sorry,” said Jon B. Alterman, director of the Middle East Program at the Center for Strategic and International Studies. “They will have troops who can stay, and if they have to curtail and come home early, nobody will complain about getting to spend more time with their family.”

“But how this all will shake out remains to be seen,” Alterman said. “There has been widespread expectation that we would work out a deal [for U.S. troops to stay], but not any confidence in what that will be.”

Alterman added that unpredictable Iraqi politics could mean a decision could come down uncomfortably close to the wire. U.S. military commanders have been warning since the spring that they will soon need to swing into high gear to extract the equipment necessary to be ready to leave the country by the end of December.

“It’s like moving a ship. It takes time, and that’s the problem,” Alterman said.

Developments this past week could complicate efforts to reach a quick decision.

A spokesman for Iraqi Prime Minister Nouri al-Maliki said the government would reopen an investigation into a 2006 raid in which U.S. forces killed at least 11 Iraqi civilians.

In documents newly released by WikiLeaks, a U.N. inspector says U.S. soldiers “handcuffed all the residents and executed all of them.”

In recent days, Maliki has said the nearly 50,000 troops who remain in the country would leave as scheduled. A few hundred will stay under diplomatic protections as trainers, U.S. officials have said.

In an e-mail Friday, Maj. Gen. Jeffrey S. Buchanan, chief spokesman for U.S. forces in Iraq, called the deployment of guardsmen from Maryland and other states in the 29th a “normal rotation” to continue aiding the development of Iraqi forces.

“We have continued to replace units here on a regular basis . . . and have kept our troop levels fairly consistent,” Buchanan said. “We have a lot of work still to do and we are determined to get as much done as we possibly can.”