One suspect is dead and two others may still be at large. Witnesses reported a man firing indiscriminately.
Police in the Louisiana state capital warned residents to stay away from the scene of the shooting, which was near the police headquarters and a highway.
It follows the recent killing of a black man by police in Baton Rouge, which sparked protests.
That, and another police killing in Minnesota, triggered a revenge attack by a black army veteran who shot dead five officers in the city of Dallas.
President Barack Obama said in a statement: “I condemn, in the strongest sense of the word, the attack on law enforcement in Baton Rouge.”
He said there was no justification for violence against law enforcement and such attacks “are the work of cowards who speak for no-one”.
Mobile phone footage from the scene in Baton Rouge showed police cars arriving at a road intersection. Several shots were then heard.
Police are reported to be using a robot to check for explosives at the scene.
The local sheriff’s department spokeswoman told WAFB TV the incident began shortly before 09:00 local time and was being treated as “an active situation”, with road closures in the area.
She said officers had responded to reports of shooting. A witness interviewed by the station said the shooting appeared to have broken out before law enforcement officers arrived at the scene.
Another witness said she saw a gunman wearing a black mask and military-style clothing.
The condition of one of the injured officers taken to hospital has been described as critical, while another has been described as being in a “fair” condition.
Baton Rouge mayor Kip Holden said he had spoken to White House officials who had offered assistance. He said it was “a defining moment” for community relations.
But he also told local media the “rhetoric from some people” after the death of Alton Sterling in Baton Rouge may be connected to the shootings, without elaborating who.
“Everything’s been anti-police,” he said.
Louisiana governor John Bel Edwards said on Twitter: “This is an unspeakable and unjustifiable attack on all of us at a time when we need unity and healing.
“Rest assured, every resource available to the state of Louisiana will be used to ensure the perpetrators are swiftly brought to justice.”