In the past, attacks in the capital have mostly been confined to targeting security forces linked to the state or militias, as well as diplomatic mission buildings and foreigners.
Several people are reportedly dead after an attack on Libya's electoral commission headquarters.
According to the official, the terrorists, including a suicide bomber, entered the office, started shooting and set the building on fire.
The suicide bomber blew himself up inside the building in central Tripoli, while other militants set fire to it, Health Ministry spokeswoman Wedad Abu Niran told The Associated Press.
The attack on the offices of the country's election commission happened as the commission was registering voters ahead of elections to be held later this year..
Time's Up movement calls for boycott of R. Kelly
Women of Color of Time's Up aims to organize around issues that are especially important to women and girls of color. And we declare with great vigilance and a united voice to anyone who wants to silence us: their time is up.
Libya has been in a state of turmoil since a 2011 civil war resulted in the overthrow of longstanding ruler Muammar Gaddafi by rebel fighters backed by North Atlantic Treaty Organisation air strikes.
In a statement carried by its Amaq news agency and circulating on social media, IS says the Wednesday attack involved two fighters who infiltrated the area and fired on election center workers before blowing themselves up.
It may not come as a surprise, given Libya's precarious security conditions, but it will still have sent shockwaves around Tripoli because of the target and its reported victims, which included election commission employees.
Militants including some with links to Daesh and Al Qaeda have a presence in Libya.
Some Libyans and members of the worldwide community have questioned the push for new elections this year, expressing concern about the lack of security as well as legal and logistical challenges.