LONDON — Prime Minister Boris Johnson once hailed fracking as “glorious news for humanity,” and said the British government should “leave no stone unturned, or unfracked.”

But in a major U-turn, Mr. Johnson’s government announced on Saturday that it would temporarily halt fracking in the only active site in Britain, in northwestern England. The move came after a government agency, the Oil and Gas Authority, concluded this past week that it could not rule out “unacceptable” consequences for people living near fracking sites, including pollution risks and earthquake-related damage.

It was a victory for environmental groups, and might deprive opposition parties of a potentially powerful campaign issue in a general election just weeks away.

Jonathan Bartley, a leader of the Green Party, described the move as “very, very welcome.” But he told the BBC that the group wanted an absolute commitment from the government to ban the practice outright.