WASHINGTON — The Senate on Thursday confirmed Andrew R. Wheeler to be the administrator of the Environmental Protection Agency, giving oversight of the nation’s air and water to a former coal lobbyist and seasoned Washington insider.

The confirmation formalized a role Mr. Wheeler has held in an acting capacity since the summer when President Trump’s first administrator, Scott Pruitt, resigned amid multiple ethics inquiries.

The vote, 52-47, went mostly along party lines and underscored partisan divisions over the Trump administration’s continued commitment to repealing environmental regulations under Mr. Wheeler.

Senator Susan Collins of Maine was the only Republican to vote against Mr. Wheeler.

“The policies he has supported as acting administrator are not in the best interest of our environment and public health, particularly given the threat of climate change to our nation,” Senator Collins said.