On Tuesday, the Senate confirmed Eric Fanning as secretary of the US Army — making him the first openly gay leader of an American military branch.

The confirmation shows just how far gay rights have come in the military under the Obama administration. In 2011, the military officially dismantled its anti-gay "don't ask, don't tell" policy. Five years later, not only can gay soldiers serve openly in the military, but an openly gay person can lead a major military service.

As NBC News reported, Fanning was previously the Army secretary's principal adviser on management and operation. He also served as undersecretary of the Air Force for nearly two years and acting secretary of the Air Force for several months while, the Army Times noted, the nomination of now–Air Force Secretary Deborah Lee James languished in the Senate.

Fanning's nomination took eight months to get through the Senate, but it wasn't over his sexual orientation. Instead, Sen. Pat Roberts, a Republican from Kansas, blocked the nomination over his opposition to the Obama administration's attempts to shut down the US military prison in Guantanamo Bay. It took an intervention from other senators, including John McCain, to get Roberts to drop his opposition, leading to a big milestone for gay Americans.

But the milestone also acts as a reminder of some of the work left to be done on LGBTQ rights in the military. As it stands, the military still technically prohibits transgender soldiers from serving openly — a ban that the Department of Defense is currently reviewing and is expected to repeal soon. Until then, some LGBTQ soldiers still aren't able to serve openly in the military, even as one of the branches is now led by an openly gay man.

Watch: How most states still allow discrimination against LGBTQ people