The U.S. Justice Department is preparing to open an antitrust investigation into Alphabet Inc.’s Google, according to a person familiar with the matter, marking the Trump administration’s first major step to scrutinize the potentially anti-competitive conduct of a giant technology firm.

The move comes after the Justice Department reached an agreement with the Federal Trade Commission that scrutiny of the company’s conduct would fall to the department’s antitrust division, according to two people who declined to be identified discussing a...