WASHINGTON | Stuck in a 2-for-39 slump that sent his average below .200, Ian Desmond stood in left field on a soggy, windy day at Nationals Park feeling good about himself.

Even though he was 0 for 3 to that point, he was feeling comfortable at the plate again.

Desmond carried those good vibes into the ninth inning and hit a tiebreaking, two-out homer against his former team as the Colorado Rockies rallied to beat the Washington Nationals 6-5 on Sunday.

“I felt like good things are coming, good things are coming. I kept on telling myself that,” Desmond said. “I just felt good. I just had that feel back. And what a perfect moment for it to come back.”

Charlie Blackmon drove in three runs for the Rockies, who took three of four in Washington as the Nationals ended a dispiriting homestand.

Desmond played his first seven seasons in the majors for the Nationals, through 2015. He became an All-Star shortstop and hit 110 home runs with Washington.

Bryce Harper hit his big league-leading seventh home run for Washington, connecting in the first and pausing to admire his deep drive to right-center.

Blackmon did his damage against the otherwise stingy Stephen Strasburg. His two-out homer in the fourth was the Rockies’ first hit off Strasburg, who retired the first 11 batters.

In the sixth, Blackmon squeezed a grounder past first baseman Ryan Zimmerman into the right-field corner to score two runs and tie the game at 3. Gonzalez followed with a single against the shift to score Blackmon.

Adam Ottavino (3-0) got the win despite being rattled by the speedy Michael A. Taylor. After Taylor doubled down the left-field line with two outs in the eighth, he stole third easily. Then he bluffed stealing home to get Ottavino’s attention.

On the next pitch, Taylor danced a third of the way down the baseline and Ottavino distractedly threw a wild pitch, allowing Taylor to race home.

Wade Davis worked the ninth for his seventh save in eight opportunities as slugging Colorado improved to 7-4 away from hitter-friendly Coors Field this season.

“It was a great game. It was entertaining,” Rockies manager Bud Black said. “You wouldn’t expect a game like that to end up the way it did, because of the 10 walks and some of the wild pitches and stuff, but it’s baseball, man. It was great.”

The Nationals won just three times in their 10-game homestand and are 3-9 since starting the season 4-0. Washington did not get a hit with a runner on base, and three of its runs came on miscues by Colorado. Cleanup hitter Ryan Zimmerman went 0 for 5, grounding out to short with Harper on first base to end the game, and his average dropped to .122.

“It wasn’t good. We should have won some more games. But you know what? The effort is there,” Nationals manager Dave Martinez said.

Rockies starter Tyler Anderson was pulled with two outs in the fifth after allowing his sixth walk. Antonio Senzatela came on and his 2-1 pitch, an inside fastball to Zimmerman, got past catcher Chris Iannetta. Taylor scored on the passed ball and Trea Turner also scored after Iannetta’s throw sailed over Senzatela’s head for an error.

Matt Wieters homered in the sixth to tie it for Washington. DJ LeMahieu put the Rockies ahead 5-4 in the eighth with a homer to right-center off Shawn Kelley, the second homer the right-hander has allowed in 5 2/3 innings this season. Kelley allowed a dozen long balls in 26 innings in 2017.

Strasburg allowed four runs on four hits in six innings.

“I think something’s missing right now, and times like that you can sit there and let it keep going or grind,” Strasburg said. “I think that’s what we’re trying to do and it’s all we really can do. We’re too good of a team to not be winning games.”

TRAINER’S ROOM

Nationals: 2B Daniel Murphy (offseason knee surgery) was scheduled to report Monday to Washington’s extended spring training in West Palm Beach, Florida, Martinez said. There is no timetable for his return to the lineup. The three-time All-Star was in the clubhouse Sunday morning, wearing a knee brace. “I would think that he’d have to treat it like spring training and we’ll see where he’s at. The biggest thing, we got this far, is not to start pushing him,” Martinez said. … 3B Anthony Rendon, who fouled a ball off his left big toe on Friday, remained day to day. “It was pretty swollen, black and blue, so I would assume when you get hit like that, you’re probably going to lose a nail,” Martinez said. “It wasn’t pretty.”

WINDS OF DECEPTION

Harper blamed the wind for getting doubled off after a routine flyball to deep center by Howie Kendrick.

“When you hear a ball that loud off the bat, you think it’s definitely off the wall or even a homer,” Harper said. “I was scoring and the wind knocked it down and I got doubled up.”

TRAILBLAZER ON THE MOUND

Congressman John Lewis, a Georgia Democrat and civil rights leader who helped direct the march over the Edmund Pettus Bridge in Selma, Alabama, in 1965, threw out the ceremonial first pitch on Sunday, the day Major League Baseball honored Jackie Robinson for breaking the color barrier. He received a warm ovation from the sparse crowd.

“John Lewis is John Lewis. The name speaks for itself,” Martinez said. “He’s just one of those people that, you know, people respect and admire.”

Sunday was also the Nationals’ annual Black Heritage Day, and pregame ceremonies also included Lt. Gen. Leslie Smith, the inspector general of the U.S. Army, and members of the Mamie Johnson Little League and the Jackie Robinson Foundation and students from Howard University.

NO-SHOWS

Attendance was announced at 25,462, but there appeared to be less than half that number in the stands. The gametime temperature was 52 degrees with strong wind and intermittent rain.

UP NEXT

Rockies: Right-hander German Marquez (0-1, 4.97 ERA) starts the opener of a three-game series at Pittsburgh on Monday night against Pirates left-hander Steven Brault (2-0, 3.46).

Nationals: Begin a three-game series at the New York Mets with right-hander Jeremy Hellickson making his Washington debut against Mets ace Jacob deGrom (2-0. 3.06).