The Trump administration's failure to keep senior adviser Jared Kushner's trip to Iraq secret isn't standard practice for top U.S. officials visiting warzones. Such trips are usually kept quiet, with the cooperation of journalists, until the officials arrive in order to ensure maximum security.

A senior administration official told reporters Sunday evening that Kushner — President Donald Trump's son-in-law — was in Iraq, even though he was still en route. For the military and security professionals managing the mission, the public disclosure of the unannounced trip was a security breach. Gen. Joseph Dunford, the Joint Chiefs of Staff chairman, also was on board.

Although the plane landed safely in Baghdad on Monday, the Iraqi capital is hardly a secure location, having suffered countless extremist attacks over the years. The threat is no less acute today as Iraq wages a bitter battle to try to rid the Islamic State from its territory. For trips to the city, the military seeks to avoid public mention of plans ahead of time so extremist groups can't plot attacks.

"It's been longstanding practice to strictly avoid announcing the visits of senior U.S. officials in advance of their travels to warzones," said George Little, a Pentagon and CIA press secretary for Leon Panetta, who managed both departments under President Barack Obama. "The main reason is obvious. You want to avoid giving the enemy any information that could help them to target these delegations, especially in areas where the battle lines aren't clear on the map."

Knowing when and where a senior U.S. military or civilian official might arrive makes attacks easier. Such details could help groups target the plane as it takes off or lands, or use roadside bombs or shoulder-launched rockets to strike dignitaries while they're on the ground.

U.S. security details work with host countries to make sure routes and buildings are secure, trying to do so in the most inconspicuous manner possible.

The choice of plane, too, is determined by danger level. In warzones, officials often fly more rugged combat aircraft, such as the Air Force's heavy C-17 transport plane. These can take off and land quicker on shorter runways. Steeper, corkscrew landings are sometimes preferred to minimize the threat from surface-to-air missiles.

Reporters cooperate, too. Those traveling with top leaders into conflict areas must keep the trip secret, with reports generally "embargoed" until landing. Restrictions can be tighter on rare occasions.

But these practices all are predicated on the administration not making the trip public prematurely.

"The moment of vulnerability is, if they know you're coming, a surface-to-air missile going after the airplane," said Ari Fleischer, President George W. Bush's White House press secretary. "If you can diminish the time they know — and by the time you're there, the whole thing is a flood of security agents — it makes it almost impossible in theory for them to do anything bad."

For the Trump administration, Kushner's voyage marks the second time a secret trip hasn't gone as planned.

In February, the White House arranged for Trump to visit Dover Air Force Base in Delaware to honor the returning remains of a U.S. Navy SEAL killed a week earlier. In keeping with the practice of past White Houses, the trip wasn't announced. News organizations agreed not to report on the trip until after Trump arrived at the base.

But unlike past occurrences, Trump left the White House in broad daylight in Marine One from the South Lawn of the White House, taking off in full view of pedestrians. The AP was forced to report that Trump had left the building.

For the last 15 years, as Republican and Democratic presidents and Cabinet members have traveled in and out of Iraq and Afghanistan, media have largely adhered to the unwritten rules.

In 2003, when then-President George W. Bush secretly traveled to Iraq to see troops on Thanksgiving Day, about a dozen reporters accompanying him had to hand over their cellphones, pagers and other electronics upon boarding Air Force One. They couldn't file stories while Bush was on the ground, only after he left Iraqi airspace.

There have been occasional mistakes and misunderstandings. Host countries sometimes spill the beans and Cabinet members also slip up, though rarely with details about flights as they're incoming.

Security incidents aren't uncommon.

When Defense Secretary Panetta's plane was taxiing after landing in Afghanistan in 2012, an Afghan contractor hijacked an SUV and tried to run down senior Marine officers waiting on the ramp to welcome the Pentagon chief. The contractor then set himself aflame inside the vehicle, forcing the plane to taxi elsewhere on the runway to avoid the fire.

Officials said they didn't think the man knew about Panetta's arrival.