The U.S. Naval Academy will ban people who are transgender from attending the school, beginning with the 2020 school year.

The Defense Department confirmed the policy change to the Capital Gazette newspaper on Monday. The school in Annapolis, Maryland, currently accepts transgender students and retains midshipmen who transition to another gender. The new policy applies to students enrolled in the 2020-21 school year and beyond.

The Obama administration lifted restrictions on transgender service members in 2016. It allowed them to serve openly and covered gender affirmation surgery.

Get Breaking News Delivered to Your Inbox

The controversial ban, announced by President Trump in 2017, went into effect earlier this month. The new regulation keeps transgender troops from serving in the nation's military openly and also "blocks all use of DoD or DHS resources to fund sex reassignment surgical procedures."

The Defense Department says people can serve if they remain their biological sex. They estimate that nearly 15,000 troops identify as transgender and could potentially be impacted by the policy.

Under the new policy, any person who has been diagnosed with gender dysphoria and has received medical treatment — either hormones or surgery — will not be allowed to join the military. If they have been diagnosed, but have not received medical treatment, they will still be eligible to join.

The Supreme Court ruled the military could enforce its policy on transgender service members after Mr. Trump called for a blanket ban back in 2017 via tweet, claiming the U.S. military "cannot be burdened with the tremendous medical costs and disruption that transgender in the military would entail." The revised policy that would still ban most transgender people from military service was later approved by then-Defense Secretary James Mattis last year.