ANAHEIM, Calif. — It’s difficult to improve when everything seems to be going right, but Boston Red Sox pitcher Rick Porcello found a way to do it.

Porcello entered the game against the Los Angeles Angels on Friday night without a loss since May 17. He had won five consecutive starts and seven straight decisions.

READ MORE: Dartmouth College Requires Remote Employees Be Vaccinated

But the one thing Porcello hadn’t accomplished all season, and all last season for that matter, was to throw a complete game. But he did just that, getting his first complete game in nearly two years to lead the Red Sox to a 6-2 win over the Angels at Angel Stadium.

Porcello gave up two runs on five hits while making an economical 107 pitches to improve to 14-2, matching the White Sox’s Chris Sale and the Orioles’ Chris Tillman for the American League-lead in wins.

Porcello pitched to contact, striking out only three and walking none, helping keep his pitch count down. He retired the Angels in order in the first, third, fifth, seventh, eighth and ninth innings. He finished the game by retiring the final 11 batters he faced.

It was Porcello’s first complete game since Aug. 20, 2014, when he shut out Tampa Bay while pitching for Detroit.

“I think around the sixth or seventh I looked up and saw where my pitch count was at and felt like with their aggression and the command I had tonight I kind of had a chance,” said Porcello, who now has five career complete games. “But it’s kind of a dangerous thing thinking about that. You’ve always got to take it one pitch at a time, one hitter at a time.”

The only damage the Angels offense inflicted on Porcello came in the second inning when Albert Pujols led off with a single and went to third on a double by ex-Red Sox outfielder Daniel Nava.

Andrelton Simmons drove in one run with a groundout and Carlos Perez scored the second with a two-out single. After that, Porcello allowed only two more baserunners — a single by Pujols in the fourth and a single by Kole Calhoun in the sixth.

“We had some opportunities, hit some balls hard, scored a couple runs early, but he settled in and we didn’t get too many good looks at him as the game moved on,” Angels manager Mike Scioscia said. “He pitched a good game for those guys, for sure.”

READ MORE: Veteran Sportscaster Bob Neumeier Dies

The Red Sox had only seven hits, two of them coming from Xander Bogaerts, who had an RBI double in the third inning and a two-run homer in the seventh, the latter giving Porcello some late-inning breathing room.

Angels starter Tim Lincecum (2-5) bobbed and weaved his way through five innings, giving up four runs and five hits. He was hurt most, though, by his inability to throw strikes. He walked a season-high six batters.

“The first probably 30 or 40 pitches that Tim threw, I thought it was pretty obvious,” Scioscia said. “He had a lot of problems with his delivery, his release point, couldn’t get the fastball in the zone where he wanted to. Later on he did have some stretches where he looked like he was in sync and made some much better pitches. But all in all, I think it’s safe to say some things plagued him.”

Lincecum could not find the strike zone at the outset, throwing eight straight balls to begin the game, walking Mookie Betts and Dustin Pedroia. But he retired the next three hitters — Bogaerts, David Ortiz and Hanley Ramirez — to escape.

Lincecum’s wildness caught up with him in the third when he walked both Betts and Pedroia again, this time with one out. Bogaerts doubled in one run and Ortiz singled home another to tie the game at 2-2.

In the fourth, the Red Sox turned a leadoff single by Aaron Hill into a run, Betts driving it in with a sacrifice fly for a 3-2 Boston lead.

When he gave up a solo homer to Jackie Bradley Jr. to lead off the sixth, Lincecum was done for the night.

“I was sitting on curveball,” Bradley said of his approach at the plate in that at-bat. “He threw me first pitch, a curveball, for a ball. I took two fastballs, one for a strike, one for a ball. Then it was probably the first time I sat on an off-speed pitch the whole year. I took a chance, a gamble, and that was my reward for it.”

With the win, the Red Sox gained a game on first-place Baltimore in the American League East, moving to within 1 1/2 games of the Orioles. They are also one game behind second-place Toronto, but remain in the second wild-card spot, 1 1/2 games ahead of Houston.

MORE NEWS: Beverly Man Dies While Hiking On New Hampshire Trail

NOTES: Angels RHP Garrett Richards, out since May 1 because of a torn ulnar collateral ligament in his right elbow, will be evaluated on Wednesday next week to determine of the stem-cell therapy he opted for is working. If not enough progress is being shown, Richards will have Tommy John surgery, which would put him out until the 2018 season. If the treatment is working, it’s conceivable Richards could begin a throwing program that would allow him to be ready by the start of next season. … Red Sox RHP Brad Ziegler was not available for the game after pitching in two consecutive games and suffering the loss in both. Red Sox manager John Farrell said RHP Matt Barnes would get the call in a save situation.