LONDON — Britain would bring its net production of greenhouse gases to zero by 2050 under legislation that Prime Minister Theresa May proposed on Wednesday, a move that would make it the first of the world’s major economic powers to commit to ending its contribution to global warming.

The plan does not say how the nation would reach the emissions goal or what it would cost, and future governments could change course — in fact, the proposal appears to leave the door open to backing away from the commitment if other countries do not follow Britain’s lead.

But Mrs. May’s bill, a bid to leave a legacy in her final weeks in office, sets a new bar for measuring environmental progress by the world’s major industrial powers.