Spanish offices, shops and hospitality venues will no longer be allowed to set their cooling systems below 27C in summer nor raise heating above 19C in the winter under a new set of energy-saving measures.

Shops will also be obliged to keep doors closed and heating systems must be checked more often to increase efficiency under the new measures, Spanish Ecological Transition Minister Teresa Ribera said.

The measures include switching off store window lights after 10pm. Street lighting will not be affected.

The government passed the bill as part of a bid to reduce the country’s gas consumption by 7% in line with the recent European Union energy agreements to limit dependency on Russian gas.

Ms Ribera said the measures would initially be maintained until November 2023.

Prime Minister Pedro Sanchez announced the new package last week, saying: “You just need to walk into a shopping mall to realise that maybe the temperature is set too low.”

Spanish public institutions already operate similar energy-saving regulations.

The government says the measures will not only save energy but will also bring down bills for households and businesses.

Spain is one of the hottest European countries in summer. The country has already had two heat waves this year with temperatures often surpassing 40C for several days in a row.

Temperatures are forecast to soar again in the first weeks of August.