WASHINGTON — Hours after President Trump took his oath on Friday, the Justice Department issued an opinion saying that his appointment of his son-in-law, Jared Kushner, as a senior White House adviser would be lawful despite a federal antinepotism law.

In a 14-page opinion signed on Friday, a longtime career lawyer in the Justice Department’s Office of Legal Counsel said that the president’s special hiring authority exempted White House positions from a 1967 law barring the president from employing relatives at a federal agency.

Some legal experts had raised concerns that Mr. Kushner’s appointment violated that law, which Congress enacted several years after President John F. Kennedy had appointed his brother Robert as attorney general.

But the new Justice Department opinion, signed by Daniel L. Koffsky, a deputy assistant attorney general in the legal counsel office, said Mr. Trump had the power to appoint Mr. Kushner anyway because of a subsequent 1978 law that gives the president the authority to appoint White House staff members without regard to other laws restricting employment and compensation of federal employees.