Jared Kushner, holding son Theodore, at Saturday’s National Prayer Service in Washington National Cathedral. (Mandel Ngan/Agence France-Presse via Getty Images)

President Trump’s decision to appoint his son-in-law as a senior adviser did not violate a federal anti-nepotism law, the Justice Department found in a formal legal opinion issued Saturday.

The 14-page opinion, written by a more-than-20-year veteran of the department who had been honored by former attorney general Eric H. Holder Jr., concluded that the president has special hiring authority that overrides a federal law that forbids executive branch officials from employing family members.

Although issued by his own Justice Department, the opinion provides Trump official support for his appointment of Jared Kushner, who is married to his daughter Ivanka, to a top White House role.

The opinion’s conclusion matched a legal analysis that had been put forward by Kushner’s lawyer, Jamie Gorelick. Gorelick had served as a senior Justice Department official under President Bill Clinton.

Kushner was one of Trump’s closest advisers during the campaign and will probably be one of his most powerful influences in the White House. Like his father-in-law, he worked as a real estate magnate in New York City, amassing hundreds of millions in holdings that he has said are now in a blind trust.

Trump critics have charged that Kushner’s White House role runs afoul of a 1967 law that forbids executive branch agency heads from appointing family members to positions in the department they oversee. Sons-in-law are included among the relations envisioned in the law, which was passed after President John F. Kennedy named his brother as attorney general.

But Deputy Assistant Attorney General Daniel L. Koffsky wrote that the law that appropriates funding for White House staff also gives the president special authorities to name his own employees, including family members.

He wrote that past opinions that had said otherwise, including a 1977 finding that the White House could not employ the president’s son as an unpaid assistant, had invoked a flawed reading of the anti-nepotism law’s legislative history and failed to take into account special authorities afforded to the president elsewhere in the law.

“In choosing his personal staff, the President enjoys an unusual degree of freedom, which Congress found suitable to the demands of his office,” he wrote.

Koffsky noted that it makes sense that the law would allow the hiring of family members given that no law could prohibit the president from taking informal advice from his relatives. Allowing the president to formalize the relationship by naming relatives to White House staff positions means they are subject to other rules and restrictions placed on federal employees.

Opinions from the Office of Legal Counsel represent the government’s formal, legal analysis of an issue, and its analyses have in the past provided cover for policymakers’ controversial decisions.

The Justice Department in 2003, for example, asserted that laws prohibiting assault and other crimes did not apply to military operators questioning al-Qaeda captives, because the president’s authority overrode other statutes. That opinion provided legal foundation for the use of aggressive tactics, though the department later backed down from its advice.

Although someone theoretically could challenge Kushner’s appointment, Trump’s defense would now be bolstered because he was following the guidance of government lawyers, and it might be difficult to find a plaintiff who would have standing to sue over the issue.

The opinion, published Saturday on the department’s website, was dated Jan. 20, an indication that it was researched and written before Trump’s inauguration. Koffsky is a career Justice Department lawyer who was honored in 2015 with the department’s Mary C. Lawton Lifetime Service Award, reserved for employees with at least 20 years of service.

Matt Zapotosky and Sari Horwitz contributed to this report.