The Obama administration is prepared to increase assistance to Yemen if its new government moves quickly to restructure its military forces, stem official corruption and implement electoral reforms, a senior U.S. official said Monday.

In conversations with Yemeni and opposition officials, the administration has made clear that “we plan to step up [aid] if they meet our test,” said John O. Brennan, President Obama’s top counterterrorism adviser.

Brennan, speaking by telephone from Saudi Arabia after a two-day visit to Yemen, said that the presidential election Tuesday “is a very important step, but it is just a step. “ The Yemenis, he said, “recognize they have a lot of work before them.”

The vote is part of a brokered agreement with opposition forces in which President Ali Abdullah Saleh ceded power late last year to his vice president, Abed Rabbo Mansour Hadi. Hadi, who will now be formally elected to the job as the only candidate on the ballot, has pledged to open a dialogue with opposition and secessionist forces in the north and south and prepare the country for full-fledged elections in two years.

But his most important pledge to the Obama administration is to continue counterterrorism cooperation against Yemen-based al-Qaeda in the Arabian Peninsula, or AQAP. U.S. intelligence officials have said that the al-Qaeda branch poses the most active current threat to the United States and its allies.

Since protests against Saleh’s 33-year regime began early last year, the military has split among those loyal to him and those supporting the political opposition. Although the street battles that wracked Sanaa, the capital, have waned, the country remains divided under the various factions.

Brennan and other U.S. officials have said that Yemen’s domestic upheaval has not affected counterterrorism cooperation with specially trained Yemeni troops who work with the U.S. Joint Special Operations Command and the CIA in targeting AQAP leaders such as Anwar al-Awlaki, a Yemeni American killed in a U.S. drone attack there last year.

Over the past several months, however, AQAP and other militant groups have taken advantage of the political turmoil to seize territory in the southern part of the country, giving them a new territorial base from which to operate, and formed an alliance with elements of the al-Shabab militant group in nearby Somalia. Yemen’s poorly equipped forces have made little progress in efforts to combat them.

Brennan said direct U.S. efforts in Yemen are aimed only at “hard-core members” of AQAP, numbering “in the dozens,” who are involved in planning attacks against the United States. A broader group numbering several hundred fighters, he said, have joined AQAP on the fringes from tribal and other groups in exchange for money.

Although the United States wants to “remove from the battlefield these several dozen,” he said, it hopes that the Yemeni military, with increased logistical, equipment and training support, can form a better fighting force as it “disaggregates” those who have no ideological affinity for the insurgents.

“We are looking at their needs,” Brennan said of Yemen’s military, including logistical support to “give them the ability to move forces to areas where al-Qaeda now has a strong foothold.”

The administration set aside about $50 million in military assistance for Yemen last year, part of which was suspended when the country’s military forces split and troops began shooting at each other.

Although Saleh has stepped down, his son and other relatives head units of the armed forces that have battled over the past year with troops fighting under the banner of senior commanders who have defected from the government.

During his visit to Yemen, Brennan said, he told the commanders on all sides: “You can be in politics, or you can be in the military, but you can’t do both. . . . If you want to be in the military, you have to step away from any political engagement.”

The armed forces, he said, are personal “fiefdoms” of commanders. Among a number of reform proposals, U.S. military advisers have suggested centralizing Yemen’s military salary structure to pay troops directly and prevent division commanders from pocketing the funds.

Saudi Arabia, Yemen’s other major backer, has delivered the same message, Brennan said.

U.S. economic assistance for fiscal 2012 is $50 million, equal to the military assistance, with a similar amount projected for 2013.

The money is divided among projects in education, health, governance and economic growth — which are in short supply in what is one of the region’s poorest and least developed countries.

The administration has said that it will increase its contributions and ask other international donors to help in those projects, as well as improvements in electrical and water supplies.