Story highlights NEW: Four people are killed, an official says

Four people are killed, an official says NEW: An unspecified number of people are detained

An unspecified number of people are detained The clashes were over control of a building, a spokesman says

Clashes between militias have erupted several times in recent months

Clashes erupted Tuesday in Libya's capital between militias from Tripoli and Misrata, killing four people, officials said.

The clashes were over control of a building that previously housed an intelligence center under former Libyan leader Moammar Gadhafi, said Col. Abdul Monem al-Tunsi, spokesman for the Interior Ministry. However, former rebels in Tripoli provided different, and conflicting, accounts of what caused the fighting -- meaning the motivations behind it remain unclear.

AbdelHakim Belhajj, head of the Tripoli Military Council, told reporters that four people were killed, and that an unspecified number of people involved in the incident have been detained.

Al-Tunsi said he was traveling in eastern Libya, but has received reports the situation is "on its way to being resolved." There may be injuries, he said.

While the Libyan war is over, it's not the first time rival militias have clashed, a possible reflection of mutual distrust that could pose a challenge to the nation's new leadership.

In November, dozens of fighters clashed at a Tripoli hospital in what residents said was the biggest armed confrontation in the city in weeks. While there were no deaths from gunshots, medical staff said three patients at the hospital died of stress-related causes linked to the fighting. Three Tripoli fighters were wounded in the clashes, said hospital security official Salem Abaza.

JUST WATCHED Source: Veteran jihadists sent to Libya Replay More Videos ... MUST WATCH Source: Veteran jihadists sent to Libya 02:28

In December, government officials held a meeting on the topic of the infighting. "Since the liberation of Tripoli the government has engaged in a multi-phased process to encourage militias to either leave the city or integrate into official military or law enforcement bodies," Prime Minister Abdurraheem Elkeib said in a statement at the time.

Misrata bore the brunt of the Gadhafi regime's most brutal assault during the months-long civil war in Libya. Gadhafi was captured and killed October 20.