The protesters smashed a main door to the compound and set a fire in the reception area, leading to the disposal of tear gas and gunfire, The Associated Press reported.
Thousands of demonstrators and supporters of the militia demonstrated outside while chanting "Death to America" to express anger over the attacks.
An AP reporter on the scene reported that flames were rising inside the compound, and at least three U.S. soldiers were on the roof of the main building.
U.S. diplomats and embassy staffers were brought to a fortified safe room, two of them told The Washington Post, adding that they feel secure.
The attack, described by the AP as one of the worst embassy attacks in recent history, came after the U.S. on Sunday launched airstrikes that killed at least 25 fighters of the Iran-backed militia Kataib Hizbollah. The Defense Department had said the strikes were in response to an alleged attack by the group that killed a U.S. citizen.
The State and Defense departments did not immediately return requests to comment.
President Trump tweeted in response to the incident Tuesday morning, accusing Iran of being behind the attack on the U.S. Embassy in Iraq.
"They will be held fully responsible," he posted. "In addition, we expect Iraq to use its forces to protect the Embassy, and so notified!"
The protesters, including some commanders of militia factions and some in militia uniform, pushed through a gate intended for cars. They at first stopped in a corridor a few hundred feet away from the building, while U.S. soldiers on top pointed their firearms at the protesters.
The demonstrators hung a sign saying "America is the aggressor" and shouted, "Down, Down USA!"
The demonstrators reportedly attended funerals for the fighters killed in the strikes over the weekend in Baghdad before marching to the U.S. embassy. They threw water bottles and stones over the walls, raised yellow militia flags, set up tents around the embassy, and sprayed graffiti in support of the militia.
Three trailers used by security guards at the embassy were also set on fire, but no one was immediately reported injured.
Yassine al-Yasseri, Iraq's interior minister, was on the scene and told the AP that the prime minister had cautioned that the U.S. strikes over the weekend would cause a reaction.
“This is one of the implications,” al-Yasseri said. “This is a problem and is embarrassing to the government.”
Embassy security utilized tear gas to try to prevent the crowd from moving toward the main building, an Iraqi security source told NBC News.
Live bullets and tear gas injured at least 10 protesters, according to the Popular Mobilization Forces, a group for the militias recognized in Iraq, NBC News reported.
The U.S. says Kataib Hizbollah is responsible for 11 attacks on U.S.-led coalition bases in the past two months, most recently one on Friday that killed a U.S. contractor and injured four U.S. military members.