More than 100 people were injured in the truck bomb attack in the western city of Zliten, the deadliest since the 2011 fall of Muammar Gaddafi.
IS also said it killed seven people in a separate suicide bomb attack on Thursday at the oil port of Ras Lanuf.
Libya has descended into chaos since the overthrow of Gaddafi.
In a message sent via an online messaging system frequently used by IS, the group said its Tripoli wing were responsible for the attack in Zliten.
Islamic State militants have been attacking Libya’s key oil terminals in the area around Ras Lanuf for the past week.
Firefighters were still trying to bring under control blazes at seven giant fuel tanks that were set alight by IS shelling on Thursday in nearby Sidra, officials said.
The group is present in several Libyan towns, including the eastern town of Sirte, Gaddafi’s hometown.
Meanwhile, Egypt’s foreign ministry says it is investigating reports in local media that 21 Egyptians have gone missing in Libya and may have been abducted by IS militants.
Analysis: Rana Jawad, BBC North Africa Correspondent
IS’ assertion that it was behind the attack does not come as a surprise, but it will confirm fears of the group’s wider reach in the country.
The attack also signals the group’s long-term ambitions to extend its influence in Libya, especially as it comes under increasing pressure from bombing campaigns by the US-led Western coalition in Iraq and Syria.
Observers have been quick to point out that IS is now employing a strategy similar to the one used in the past by al-Qaeda in Iraq: targeting police and army training centres to create fear and prevent the rebuilding of state security institutions.
Libya has had no proper army or police force for the past four years.
This new grim reality is only likely to be reversed if the competing militias who rule the country come together to fight against IS.
There are signs that Libya’s rival groups are starting to realise that they face a common enemy, but they are still a long way from presenting a unified front.
Funerals for those killed in the attack have been held in Zliten, 60km (40 miles) west of Misrata.
The country has been split into areas run by two governments – only one of which is recognised by the international community.
In December, rival politicians signed a UN-brokered deal to form a unity government.
In a surprise, unannounced move, the newly-appointed and internationally-backed presidency council travelled to Zliten on Friday night to pay their respects to the families of the victims.