The vote was 52-45.
Rosen replaces Rod Rosenstein, who left the department last week. Rosentein appointed special counsel Robert Mueller and had overseen his investigation.
Rosenstein's departure was expected after William Barr became attorney general this year.
Rosen was a longtime litigator who served as deputy transportation secretary in the Trump administration.
Democrats raised questions about Rosen's lack of criminal law experience.
Rosen has pointed to his management experience at the Transportation Department and said he was the chief operating officer of the agency with an $80 billion-plus budget.
Copyright 2019 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.