Yusmeiro Petit set a major league record when he retired his 46th batter in a row, and the San Francisco Giants beat the Colorado Rockies 4-1 on Thursday for their third straight win.

Petit (4-3) got the first eight Colorado hitters, establishing the mark by striking out Charlie Culberson, prompting a standing ovation by the announced sellout crowd of 41,017 at AT&T Park in San Francisco. That broke Mark Buehrle's record of 45 straight with the Chicago White Sox in 2009.

Petit's streak covered eight games, six of them in relief. The 29-year-old journeyman from Venezuela also surpassed Jim Barr's National League record of 41 in a row with the Giants in 1972.

The string ended two pitches later when the next batter, Rockies starter Jordan Lyles, doubled to left field.

"That might be a trivia answer some day," said Lyles, whose record dropped to 6-2 on the season after he allowed three runs and four hits in six innings.

He pulled Petit's four-seam fastball clocked at 89 miles per hour to left field to carve out his own place in baseball history.

Charlie Blackmon followed with a single to drive in Colorado's only run.

"I was a little nervous when the hitters were advancing toward the record. But in that pitch to the pitcher, I was not nervous," Petit said through a translator. "I was doing my job. The first pitch was fine. The second pitch was fine, too, but it slid a little bit where I didn't want it to."

Petit, a 29-year-old journeyman from Venezuela, fell one strike short of a perfect game against Arizona last September. Almost a year later, he carved out his own slice of baseball history.

The right-hander made the start in place of struggling Tim Lincecum, who was available out of the bullpen.

Petit allowed four hits, struck out nine and walked none, and his latest performance will likely earn him another turn in the rotation.