Villar's three-run shot in the bottom of the seventh inning was the 6,106th homer of the season, breaking the previous MLB single-season mark.
The previous record of 6,105 was set in 2017, marking the first season in history with at least 6,000 home runs hit. Before that season, the record stood at 5,693 home runs in 2000.
With one out and runners on second and third, Villar jumped on a first-pitch fastball from Dodgers pitcher Caleb Ferguson. The three-run homer gave the Orioles a 5-2 lead in the seventh inning.
Villar's three-run bomb was the 22nd home run of Wednesday's slate of games. It was his career-high 21st homer of the season.
Oakland Athletics slugger Marcus Semien hit the record-tying 6,105th home run earlier Wednesday night. He blasted his 28th homer of the season off Houston Astros pitcher Jose Urquidy.