The United States Marine Corps announced on Thursday that for the first time ever a female recruit has successfully completed infantry officer training.

The woman, who holds the rank of lieutenant, and a number of male colleagues finished the gruelling Infantry Officer Course on Wednesday.

The course is a demanding, 13-week program which recruits must pass if they hope to be stationed as infantry officers for the corps, according to The Washington Post.

It is given at the Marines’ training facility in Twentynine Palms, California. An estimated 25 percent of those who begin the program fail to complete it.

The female lieutenant became the first woman to successfully complete the course.

Before her, all of the three dozen females who tried to finish the program failed.

She will now likely be assigned to lead an infantry platoon of about 40 Marines.

The news is a welcome bit of good publicity for the Marines, particularly in light of recent revelations that soldiers on social media exchanged racy photos of female recruits without their permission.

US Marines in the Infantry Officer Course conduct fast-rope training near Yuma, Arizona in this 2015 file photo. The Corps announced on Thursday that for the first time ever a female recruit has successfully completed infantry officer training

The historic milestone was made possible by the US government’s move in recent years to shatter remaining barriers in the armed forces.

In 2015, then-Defense Secretary Ash Carter announced that all restrictions barring women from combat roles would be lifted.

Carter’s decision came nearly three years after the Pentagon first instructed the military to open all positions to qualified women, including front-line combat roles.

A restriction on such roles was seen as increasingly out of place during a decade of war in Iraq and Afghanistan in which women were often in harm’s way.

Women represented about 2 percent of US casualties in Iraq and Afghanistan, with some 300,000 deploying to the conflict zones.

Since the Pentagon directive in 2013, the services have been examining whether women should be excluded from any military positions.

The female lieutenant became the first woman to successfully complete the course. Before her, all of the three dozen females who tried to finish the program failed. A US servicewoman is seen above in Afghanistan in this 2010 file photo

Over the last several years, Marine leaders have battled persistent accusations that the Corps is hostile to women.

The Marines were the only service to formally request an exception when the Pentagon moved to allow women to serve in all combat jobs.

That request was denied by Carter.

More recently, the service was rocked by a nude-photo sharing scandal in which Marines shared sexually explicit photos on various social media and other websites and included crude, derogatory and even violent comments about the women.

A task force led by the Naval Criminal Investigative Service is looking into the matter.

Marine leaders have come under persistent criticism from members of Congress because the Corps is the only military service to separate men and women for portions of their boot camp.

And only the Marine Corps allows half of its recruits to go through initial training without any female colleagues.

Because there are only a small number of female Marines, they all go through boot camp at Parris Island, where they are separated from the men for portions of the training.

Congress members have been highly critical of that policy and demanded changes, and the Corps has been reviewing the issue.

Marines have argued that the separation from the men is needed so the women can become more physically competitive before joining their male counterparts.

They also have argued that it gives the female Marines the support they need during their early weeks of boot camp.

Women make up 8.4 percent of the Marine Corps, and that is the smallest percentage of all the armed services.