Jose Altuve had no trouble settling back into a groove. Dallas Keuchel couldn't quite find his.

Keuchel allowed four runs and lasted only five innings, and the Houston Astros fell 6-5 to the Washington Nationals on Tuesday night despite Altuve's four hits.

"I was kind of battling, trying to find my stuff all night," said Keuchel, who allowed six hits and a season-high four walks in his shortest outing since April 5. "I felt fortunate enough to get through five."

Altuve finished 4 for 5 with two doubles and two RBIs in his first night back in the lineup since last Thursday. He was limited to one pinch-hitting appearance in Houston's last three-game series against Tampa Bay after being hit on the right hand by a pitch.

Altuve's second double drove in a pair of runs to make it 6-5 and cap a four-run eighth inning.

"I mean, what more can you say," manager Bo Porter said of his second baseman, who is batting .370 (17 of 46) in June. "It doesn't matter who's out there. He's one of the best hitters in baseball."

But Rafael Soriano worked the ninth for his 14th save, sending the Astros to their third loss in their last four, and their 11th defeat in their last 12 against Washington.

Tanner Roark (6-4) pitched five innings in winning his third straight start.

Houston had 14 hits, its most since Memorial Day, and went 5 for 14 with runners in scoring position. Dexter Fowler, George Springer, Jason Castro and Matt Dominguez all had two hits.

"I'm really happy right now because everybody's playing hard," Altuve said.

Keuchel (8-4) came in 6-1 with a 1.33 ERA over his last seven starts, but struggled with his command in allowing four runs for just the third time this season.

After allowing two runs in the first and two more in the third, he was lifted after throwing an atypical 105 pitches through five innings.

He threw fewer pitches in each of his last three starts — all six innings or more — and before that pitched a complete game win using just 106 pitches at Seattle on May 25.

"He normally attacks the zone a little bit better," Porter said. "But he'll be fine."

Anthony Rendon doubled twice and drove in three runs for Washington, with his second double off reliever Kyle Farnsworth making it 6-1 in the sixth.

It stayed that way until the eighth, when Castro singled, Dominguez doubled and Jonathan Villar walked to load the bases with nobody out.

After a pair of strikeouts, Fowler singled in two runs and then Altuve ripped his two-run double down the left field line.

"Great job of battling," Porter said. "For us to be able to mount the comeback which we were able to mount, and have an opportunity there in the ninth inning, I'm really proud of our guys."

The Astros got seven hits and walked twice against Roark, but only scored once off the starter after loading the bases with no outs in the fourth.

After Roark fanned Castro, Dominguez hit a grounder that deflected off Roark's foot into right field, scoring Altuve to pull Houston within 4-1. Roark rebounded to get Villar on a fly to shallow left before striking out Robbie Grossman.

NOTES: Porter coached third base for the Nationals from 2011-12. Tuesday was his first visit since Washington dropped the decisive Game 5 of the 2012 NL Division Series to St. Louis after leading 6-0. "It hurt," he said of that loss. "I would say it still hurts." ... Nationals LHP Gio Gonzalez (3-4, 4.62) returns Wednesday from the 15-day DL (shoulder inflammation) and opposes RHP Scott Feldman (3-4, 3.98). ... Tuesday marked the Astros' first loss when scoring five or more runs since they lost 8-7 to Seattle on May 4.