“Mr. Bernhardt has significant private practice experience as well as a past record of service at the Department,” said Senator Mitch McConnell of Kentucky, the Republican leader, in a statement. “Along the way, he’s earned the respect of those who rely on the public lands the Department of the Interior is charged to oversee, from Native American leaders to sportsmen’s groups. He’s been praised as a ‘proven leader’ who ‘acts with integrity’ and has ‘the right approach and skill set.’”

Senator Chuck Schumer of New York, the Democratic leader, said: “It still amazes me. Donald Trump campaigns on cleaning up the swamp and he does exactly the opposite when in office. An oil and gas lobbyist as head of the Department of Interior? My God. That’s an example of the swampiness of Washington if there ever was one. And when are Donald Trump’s supporters going to understand this?”

Environmental groups who opposed Mr. Bernhardt’s confirmation were not surprised that Senator Manchinn — whose state, West Virigina, is rich in coal and who often votes with Republicans on energy and environmental policy matters — supported Mr. Bernhardt. But many environmentalists expressed anger that Senator Heinrich, who has presented himself as an environmental champion, particularly on issues of climate change, backed the confirmation of a former oil lobbyist to oversee public lands.

This week, the Western Values Project, a conservation advocacy organization, ran a television ad campaign in New Mexico urging Senator Heinrich to vote against Mr. Bernhardt.

Senator Heinrich said that, as a lawmaker from a state where roughly one-third of the land is owned and operated by the Interior Department, it was important to him to have a permanent, confirmed secretary at the head of the agency, even if the person in that role was not his first choice.

“I need to be able to pick up the phone and talk to the secretary of interior on a regular basis. I’m not going to be able to get the interior secretary I wanted. We didn’t win in 2016,” he said, referring to the presidential race. “But in New Mexico, I’m going to put my state and protection of public lands in my state first.”

The National Ocean Industries Association, a lobbying organization for offshore drilling companies, including many of Mr. Bernhardt’s former clients, cheered his confirmation. “His unparalleled depth of experience at the department and knowledge of energy and conservation policies will serve our nation’s public lands and resources well,” said the group’s president, Randall Luthi.