The District’s bag tax and several energy efficiency laws helped the city grab the title of No. 1 in “environmental governance” in the US and Canada Green City Index, said Mayor Vincent C. Gray (D) said Wednesday at his weekly news conference.

The 27-city index, commissioned by Siemens Corp., also ranked the city as No. 8 in overall environmental performance. That was based on the number of LEED-certified green buildings in the capital and other criteria. San Francisco and Vancouver topped that category. Detroit ranked the lowest overall.

In the area of water conservation, however, Washington was listed near the bottom, at No. 24.

The study was conducted by the Economist Intelligence Unit to compare the environmental performance of 27 major cities in Canada and the United States in nine categories.

Denver and New York City were ranked Nos. 2 and 3, respectively, on environmental governance. St. Louis was No. 27.

Washington ranked in the top third to top half in most categories, with the exceptions of water conservation and waste reduction, at No. 18.