BALTIMORE — Seth Smith and Manny Machado each hit solo home runs in the first inning, and starter Alec Asher threw 6 1/3 solid innings as the Baltimore Orioles defeated the Boston Red Sox 3-2 on Friday night.

Smith homered to lead off the first, and Machado added a 465-foot blast, No. 11 of the season, two batters later which gave Asher and the Orioles (29-24) an early 2-0 lead. That proved to be enough for the right-hander, who is trying to earn the No. 5 spot in the rotation.

Asher (2-3) allowed two runs on just three hits. He struck out five without a walk and left to a standing ovation in the seventh.

Pablo Sandoval clubbed a solo home run and Jackie Bradley Jr. also drove in a run for Boston (29-25).

Mychal Givens relieved Asher with one out in the seventh and allowed an RBI single to Bradley Jr. but got the final two outs. The third out came when catcher Caleb Joseph threw out Bradley attempting to steal second.

Darren O’Day took care of Boston in the eighth before Brad Brach closed it, earning his 11th save.

Asher outdueled Boston starter Rick Porcello (3-7), whose struggles continue this season after winning the American League Cy Young Award last season. Porcello allowed those two homers and three runs overall on eight hits in six innings, which he needed 118 pitches to get through.

Porcello labored through a 31-pitch first inning but the Red Sox cut the lead in half on a Sandoval homer in the top of the third.

The Orioles answered in the fourth when Jonathan Schoop singled with one out and scored on a Hyun Soo Kim double, making it 3-1.

NOTES: Baltimore 3B Manny Machado’s first-inning homer went into the second deck, the first player to hit one there at Camden Yards since Mark Reynolds on Aug. 7, 2011 versus the Toronto Blue Jays. … LF Hyun Soo Kim’s run-scoring double for the Orioles gave him his first RBI since April 24. … Boston RHP Craig Kimbrel was named as the AL Reliever of the Month on Friday. He finished 7-for-7 in save opportunities in May. … Red Sox LHP Eduardo Rodriguez, who started Thursday for the Red Sox, was placed on the disabled list (right knee subluxation). RHP Brandon Workman was recalled from Triple-A Pawtucket.