Apple is recalling some of its 15in MacBook Pro laptops over a battery fire risk.

The company said on Thursday that a limited number of its largest laptop line, sold between September 2015 and February 2017, contained batteries that “may overheat and pose a safety risk”.

Apple asked customers with MacBook Pro (Retina, 15in, Mid 2015) laptops to stop using the machines immediately and to seek to have the battery replaced as soon as possible, which would be done free as part of the recall. It said the service may take one to two weeks.

The company said anyone with the model, which cost upwards of £1,599, should cross-check the serial number of the machine on the Apple recall site. The serial number could be found by clicking on the Apple menu in the top left corner of the screen and choosing “About this Mac”.

““Customer safety is always Apple’s top priority, and we have voluntarily decided to replace affected batteries, free of charge,” Apple said in a statement.

The battery issues did not affect other 15in MacBook Pro laptops or other Mac products, it said.

Battery safety issues have been taken more seriously across the technology industry since the Samsung Galaxy Note 7 smartphone was recalled twice before being permanently discontinued after a series of battery fires.

Despite being dwarfed by iPhone sales, Apple’s Mac line of laptop and desktop computers remain a key part of the business. In its most recent quarterly financial results, Macs brought in $5.5bn (£4.2bn) in revenue.

The third-generation retina MacBook Pro is the immediate predecessor to the current fourth-generation MacBook Pro line, which dropped traditional connectivity ports for the modern USB-C standard and the Touch Bar in 2016.

In April, Apple recalled of some of its plug adapters after discovering they could break and cause electric shocks when touched.