Army Gen. Martin Dempsey, chairman of the Joint Chiefs of Staff, speaks during a graduation and commissioning ceremony May 23 at the U.S. Military Academy in West Point, N.Y. (Mike Groll/AP)

The U.S. military is gradually expanding a new program to train and equip Syrian opposition fighters, but building a force that can effectively take on the Islamic State may take longer than expected, President Obama’s top military adviser said Wednesday.

Army Gen. Martin Dempsey, chairman of the Joint Chiefs of Staff, said the training course would be a success if the United States was able to recruit, vet and train enough fighters who will form the new, moderate Syrian rebel force. “That’s going to be a challenge and may take longer than we think,” he said in an interview.

In May, the Pentagon launched the long-awaited effort when it began training an initial class of about 90 fighters in Jordan. The program, separate from an earlier CIA course, seeks to stand up a force that will counteract the Islamic State, which is trying to advance a new offensive in northwest Syria that, if successful, could reshape Syria’s civil war.

A senior military official, speaking on the condition of anonymity to discuss a program whose details are veiled in secrecy, said that the U.S. military had begun working with a second class of about 50 Syrian fighters in Turkey in mid-May. Training is expected to eventually expand to Saudi Arabia and Qatar.

The program deepens U.S. military involvement in Syria, where four years of grinding conflict have given rise to the powerful Islamic State, whose extremist realm now straddles Syria and Iraq. While the United States has been conducting airstrikes against Islamic State fighters in both countries since last year, it has steered clear of direct confrontation with forces loyal to Syrian President Bashar al-Assad.

But the relatively small scale of the training, and the difficulty U.S. military officials are facing in getting the right fighters, has raised questions about the effect the program can have in a conflict characterized by a kaleidoscope of armed groups fighting the Assad regime and one another.

In April, military officials said the training program’s start had been postponed several weeks when an initial cadre of fighters stayed back at the last minute so they could defend their homes from militants.

Opposition fighters undergo elaborate vetting procedures to minimize risks to U.S. trainers and to ensure that the rebels use U.S.-provided weapons responsibly. So far, a large share of Syrians recruited for the program have been disqualified in the vetting process, officials said, for health or age reasons, or because of suspected links to extremist groups.

But Dempsey, who is preparing to step down this fall after four years as the top U.S. military official, said the program had shown some early successes. He said trainers were now selecting leaders from among the recruits, most of whom came to the program with experience battling government forces­ or Islamist fighters.

“The feedback is that the recruits are very good,” he said. “There’s nothing like being ­battle-tested to make you take training seriously. So we do think that they are absorbing the training.”

But military officials said it was too early to say how long it would take to reach the goal of fielding 3,000 to 5,000 Syrians a year, suggesting it will not happen soon.

Officials likewise have modest expectations for the near-term impact of the program.

Dempsey said he expected that the new force would restrict the Islamic State’s ability to maneuver in areas in the “periphery” of Syria.

“The larger strategic issue is that over time . . . it should become clear that the relative advantage that ISIL has on the ground today, especially in Syria, will begin to erode once we begin to field this force,” he said, using an alternate name for the Islamic State.

Dempsey’s tenure as chairman is book-ended by the U.S. military’s exit from and return to Iraq. In late 2011, shortly after Dempsey began the job, the Obama administration pulled the last U.S. troops out of Iraq, marking an end to the war that began under George W. Bush in 2003. Last year, after Islamic State fighters took Pentagon officials by surprise when they captured much of northern and western Iraq, the White House sent a much smaller number of troops back into Iraq to train and advise Iraqi ­forces.

This time, Dempsey is determined to ensure that Iraqi troops don’t rely on U.S. forces­ to fight for them. That strategy suffered a setback last month when the city of Ramadi fell to extremist fighters.

Defense Secretary Ashton B. Carter caused a stir when he said Iraqi troops showed “no will to fight” in Ramadi.

Dempsey, who commanded the U.S. effort to train Iraqi troops from 2005 to 2007, said he had seen Iraqi forces­ fight courageously.

“I’ve got a lot of time in the saddle, as they say, with the ISF,” he said, referring to Iraq’s military and other security ­forces. “I think what happened in Ramadi demonstrated at the very least some organizational and leadership failures and vulnerabilities.”

More important, Dempsey said, Iraq’s military, mainly composed of Shiite Muslims, must demonstrate that it is willing to defend a range of communities in religiously and ethnically mixed Iraq.

“It’s not a matter of do they have the will to fight, but what are they willing to fight for,” he said.