Companies representing a range of energy interests, from old-school oil and gas to renewables like solar and wind power, are pumping millions into lobbying efforts in Massachusetts.

In 2018, as many as 70 energy businesses and advocacy groups reported spending at least $5.3 million trying to get their messages through to Beacon Hill legislators and policymakers, according to a review of public lobbying records. Some of the top spenders were involved in renewable energy.

The spending was much the same in 2017, when a similar number of groups spent about $5.1 million on lobbying.

It’s a dramatic shift from 2005, when just two dozen companies reported spending a total of about $1.2 million on lobbying. Few of those companies were primarily involved in renewable power.

The spending comes at a time when Massachusetts is undertaking a long-term seismic shift in its energy landscape with the rise of solar, hydro and wind power, including what could be the nation’s largest industrial-scale wind farm south of Martha’s Vineyard known as Vineyard Wind.

The growth of renewable energy is in part due to a 2016 bipartisan energy bill signed by Republican Gov. Charlie Baker that authorized the largest procurement of clean energy generation in Massachusetts’ history, including about 1,600 megawatts of offshore wind energy.

The company spending the most on lobbying in 2018 was NextEra Energy, which describes itself as the world’s largest utility company and the largest producer of wind and solar energy. The company spent about $372,000 on lobbying which it said was related to “the production, transmission, distribution, sale and ancillary services associated with electricity.”