"I am at the morgue where six bodies from the site of the attack were brought, including the body of a child," said Mansour Ati, the head of Libya's Red Crescent.
The attack was carried out by a suicide bomber at the entrance to the town of Ras Lanouf, said Ossama al-Hodeiri, a spokesman for the security forces that guard nearby oil facilities, who was at the scene.
"A driver in a Toyota Land Cruiser blew himself up at a checkpoint at the entrance to the town of Ras Lanouf," said Hodeiri.
He said three guards and a 16-month-old baby were killed, and that two other guards had been wounded. Ati said two other people died in the assault but their identities were not clear.
Reports suggested they were relatives of the baby. The suicide bombing comes after the Islamic State group launched an offensive on Monday against Libya's key oil terminals in Ras Lanouf and nearby Al-Sidra.
It also coincided with a suicide truck bombing early today on a police training school in the coastal city of Zliten, east of Tripoli, that killed more than 50 people.
At least four oil storage tanks have been set on fire during the fighting, which also killed at least 10 security guards, according to the National Oil Company and Ali al-Hassi, a spokesman for guards at Al-Sidra.
Ras Lanouf and Al-Sidra are located in the so-called "oil crescent" along Libya's northern coast. IS has been trying for several weeks to push east from its coastal stronghold of Sirte, and officials have warned of crippling consequences if the jihadists manage to seize control of Libya's oil resources.
There was no immediate claim of responsibility for today's attacks in Zliten or Ras Lanouf but IS has in the past said it was behind suicide bombings and other atrocities.
IS has been growing in power in Libya, feeding on the chaos that has gripped the North African country since the 2011 uprising that toppled longtime dictator Moamer Kadhafi.