Peter A. DeFazio of Oregon won the contest Thursday to become ranking Democrat on the House Natural Resources Committee, after Arizona Democrat Raúl M. Grijalva surprised colleagues with his decision to withdraw from consideration.

DeFazio had secured leadership backing the day before when the Democratic Steering and Policy Committee voted 33-16 to recommend him for the spot, which became vacant on Tuesday when Massachusetts Democrat Edward J. Markey was sworn in as a senator.

By exceeding a 14-point threshold, Grijalva was entitled to request a second vote from the full Democratic Caucus. Though he had signaled all along that he planned to fight until the very end, he arrived at the caucus meeting on Thursday prepared to step aside.

“I believe that, if our full Caucus were to hold a vote, I would have a chance to succeed,” Grijalva wrote in a letter Thursday to Minority Leader Nancy Pelosi, D-Calif. “I do not believe that holding the vote would best serve the larger needs of our caucus or my Democratic colleagues on the Committee.”

DeFazio was the favored candidate from the beginning, touting a 20-year tenure on the committee and holding down the No.2 spot among Democrats behind Markey. Many of his colleagues were prepared to reward him not just for his environmental record but out of deference to his seniority.

In his letter to Pelosi, Grijalva, who was the seventh most senior Democrat on the panel before Markey left, wrote that he ran against DeFazio “to offer our Caucus a choice and to raise issues not often discussed,” as well as to “represent the millions of Americans not invited to the table and to highlight the importance the outside world attaches to our internal discussions.”

Grijalva had backing from most members of the Congressional Hispanic Caucus, the majority of Democrats from Texas, New Mexico and Arizona, and a number of national Latino organizations. They saw Grijalva, indeed, as an alternative to the status quo, emphasizing his liberal politics — he is chairman of the Congressional Progressive Caucus — and highlighting the significance of having another ranking member at the Democratic leadership table who is a person of color and a staunch advocate for an immigration rewrite.

“You can’t just talk the talk if you really want to be the party that’s known for its achievements on diversity issues,” said Brent Wilkes, executive director of the National Hispanic Leadership Council.

Grijalva said in his letter to Pelosi that the engagement of the outside groups was healthy.

“My belief is stronger than ever that the Democratic Party must remember these voices and why they felt so strongly about the outcome,” Grijalva wrote. “I believe their very legitimate fight for a greater role in the Democratic Party decision-making continues well beyond this afternoon.”

Leading up to Thursday’s meeting, Wilkes’ organization was making calls to lawmakers in efforts to shore up last-minute support.

According to multiple sources in Democratic leadership that included high-ranking Congressional Hispanic Caucus members and their aides, there were even efforts within the Hispanic Caucus ranks to compel Grijalva to stay in the race until the bitter end — even as he was mulling whether it was right to subject himself and his colleagues to a doomed and potentially embarrassing vote.

Grijalva confirmed in an interview on Thursday evening that some Congressional Hispanic Caucus members did voice a preference that he remain a candidate, but he said nobody strong-armed him or pressured him to stay in the race.

“The only pressure was from some members peripheral to the issue, saying, ‘you got to do this for the greater good,’” Grijalva explained, adding that Congressional Hispanic Caucus leaders only requested that he wait until the 3 p.m. Democratic Caucus meeting to make his decision public.

Pelosi sent out an official statement later Thursday to announce the outcome of the caucus meeting and praise both lawmakers.

DeFazio, she said, has served on the panel for “more than a quarter-century ... with passion and vigor, with a keen intellect and an independent streak.”

Grijalva, she continued, was “a progressive leader” who would continue, as ranking member on Public Lands and Environmental Regulation Subcommittee, “to promote conservation, defend public lands and strengthen our beautiful national parks.”

As the new ranking member on the powerful panel, DeFazio is expected to be a reliable Democratic ally on most environmental concerns — he boasts an 89 percent lifetime score from the League of Conservation Voters — though environmental groups haven’t forgotten past breaks with the party, such as on bills to limit the EPA’s authority to regulate coal ash and pollution from industrial boilers.

Most notably, DeFazio voted against the 2009 bill to cap greenhouse gas emissions written by Markey and Rep. Henry A. Waxman, D-Calif. The “cap and trade” measure passed the House, but was never taken up in the Senate.

In a separate press release announcing his victory, DeFazio pledged to “push for a 21st century energy policy,” work toward committee action on climate change and seek to overhaul legislation that dictates how mining royalties are disbursed.

After a race for the slot that began before Markey had even won the special election to replace now-Secretary of State John Kerry, Grijalva congratulated DeFazio, referring to him in the letter to Pelosi as a “friend.”

Perhaps signalling the extent to which the competition grew personal over the course of the campaign, DeFazio made no mention of Grijalva in his own statement.