Defense Secretary Jim Mattis is expected to recommend to President Trump that transgender people can serve in the U.S. military if they can deploy overseas, a U.S. official with knowledge of the secretary’s thinking on the issue told Fox News Thursday.

The official said Mattis did not want to go against recent federal court orders which ruled Trump’s proposed ban on transgender people serving in the military is unlawful.

FLASHBACK: MATTIS FREEZES TRUMP BAN ON TRANSGENDER TROOPS PENDING REVIEW

Mattis' expected decision was first reported by The Washington Post.

Officials tell Fox News that Mattis' thinking has also been shaped by his recently announced policy that any service member unable to deploy with his or her unit for more than 12 months must leave the military.

Mattis has not yet given his recommendation to the president. Pentagon spokeswoman Dana White told reporters Thursday the secretary's recommendation would be given to the president later "this week."

FLASHBACK: TRUMP ANNOUNCES BAN ON TRANSGENDER INDIVIDUALS SERVING IN MILITARY

The official announcement about transgender policy is expected from the White House no later than March 23, according to officials. The Pentagon was caught by surprise this past July when Trump tweeted that transgender people were no longer welcome in the military "in any capacity."

The following month, Trump demanded that military recruitment policy consider transgender as "a disqualifying psychological and physical" condition.

Since then, three federal courts have ruled against the ban and some Senate Republicans -- including military veterans Joni Ernst of Iowa and John McCain of Arizona -- have voiced their objections.

The Associated Press contributed to this report.