WASHINGTON — The top U.S. military officer is leaving open the possibility of a growing security role for U.S. forces if desperation turns to violence in Haiti, a risky undertaking in a country that was chaotic even before this week’s devastating earthquake.

U.S. forces sent to Haiti to help relief efforts are operating under what two military officials said Friday is an adaptation of standard military rules of engagement that allows for self-defense even though the Pentagon does not expect a need for it. The officials spoke on condition of anonymity to characterize the confidential rules.

The Pentagon is planning for both a short-term relief mission and the possibility of a longer-term role supporting 9,000 United Nations security forces but not supplanting them, officials said. The United States has the flexibility to assume a much larger security role, but the Obama administration so far is downplaying the chance of one.

Humanitarian relief is the primary role for a U.S. force expected to grow to nearly 10,000 by Monday, Adm. Mike Mullen said Friday. The chairman of the Joint Chiefs of Staff said that whether the U.S. expands that role into policing will depend in part on the recommendation of the American commander in charge of the relief effort and on the needs of the United Nations forces.

“The initial intent is to strategically place some of our soldiers so that they can help with that relief distribution. And then, obviously, we’re all focused on the security piece as well,” Mullen told reporters at the Pentagon.

“We very much hope to stay … ahead of that, but recognize that there are possibilities there that we need to plan for.”

Cheryl Mills, counselor to Secretary of State Hillary Rodham Clinton, told a news conference the focus for U.S. troops was the relief effort.

“We’re committed to providing whatever support, but our military who is there are there on a humanitarian and a relief mission, and we are quite clear about that,” she said.

Like other U.S. officials, she praised the existing U.N. security operation but ruled nothing out.

“We have a very strong security component on the ground in the U.N. team that’s already there,” Mills said.

“We are anticipating them to continue to provide the leadership and continue to play that role. We are not anticipating that that’s a role that we have to provide, but we are committed to providing whatever support is necessary for the Haitian people.”

In a joint news conference at the Pentagon with Mullen, Defense Secretary Robert Gates said the primary goal was to distribute aid as quickly as possible “so that people don’t, in their desperation, turn to violence.” He suggested the U.S. was aware of perceptions of its profile in the ravaged country.

“I think that if we, particularly given the role that we will have in delivering food and water and medical help to people, my guess is the reaction will be one of relief at seeing Americans providing this kind of help,” Gates told reporters.

Military officials said they were trying to stave off banditry and lawlessness by rushing relief supplies including desperately needed water where it will be most effective, and also where it can be distributed in ways least likely to cause rioting or looting.

Gates said early airdrops of aid were ruled out because they might have done more harm than good.

“It seems to me that without having any structure on the ground in terms of distribution, that an airdrop is simply going to lead to riots as people try and go after that stuff,” he said.

“It seems to me that’s a formula for contributing to chaos rather than preventing it.”

Anthony Cordesman, a security analyst at the Center for Strategic and International Studies, said he saw no reason the United States would have to take over security, or that such an expansion would mean a long-term commitment of forces.

Like Gates, Cordesman said the current commitment should not become an undue strain on the military despite deployments of more than 170,000 forces in Iraq and Afghanistan.

“There is always a risk this can escalate. A lot depends on the Haitians themselves, how frustrated and angry they become with their government, how desperate they become simply to survive.”