The 15 killed included seven policemen, the officer said, giving the casualty toll on condition of anonymity because he wasn't authorized to release the information.
The attack occurred about 1 p.m., a time when large numbers of people were visiting the compound.
A car bomb across the street from the compound killed at least 40 people in April.
The U.S. military has warned that women bombers are being increasingly recruited by al-Qaida in Iraq because they can more easily avoid security searches. U.S. military figures show the number of female suicide attacks has risen from eight in 2007 to 21 so far this year - eight of those in Diyala province.
The bomber on Sunday had apparently hidden an explosives belt under a traditional black Islamic robe usually worn by Iraqi women.
One man who was hit by shrapnel in his hand and shoulder said the blast occurred as many people were leaving the compound ahead of the 2 p.m. close of business.
"I was trying to get out of the court when the explosion took place," the witness said, declining to give his name because of security concerns. "I heard some of the injured people saying they saw a woman wearing a black robe blew herself up."
Those killed included seven policemen and eight civilians, according to police and the U.S. military, which confirmed the attack.
Baqouba, 35 miles northeast of Baghdad and the capital of Diyala province, was an al-Qaida in Iraq stronghold until local tribal leaders joined forces with the Americans to turn against the terror network, helping to curb the violence.
But the city and surrounding areas have seen a series of attacks that have chipped away at recent security gains.
Elsewhere in northern Iraq, police said they have arrested six men suspected in the killing of the head of Saddam Hussein's tribe earlier this month.
Sheik Ali al-Nida, the head of Iraq's Albu Nasir tribe, and one of his guards were killed on June 10 when a bomb planted on their car exploded in Tikrit.
"Those arrested included three who are related to Sheik al-Nida and are from the same tribe of Albu Nasir, along with an Egyptian man who was the sheik's personal driver," according to a local police officer with the Major Crimes Directorate that is investigating the attack.
Al-Nida's driver, a longtime employee, confessed that the sheik's clansmen had paid him to stick the bomb to the undercarriage of the car, the officer said.
The officer, who spoke on condition of anonymity because he wasn't authorized to release the information, said the operation was financed abroad but he gave no further details.
Last year, al-Nida founded a so-called Awakening Council in Saddam's home village of Ouja, partnering with U.S. forces to fight Sunni militants in the area.
The officer said investigators suspected al-Qaida in Iraq was behind the attack as part of its campaign of violence against Sunni tribal leaders who have joined forces with the Americans.
In other violence reported by police on Sunday, a roadside bomb apparently targeting a police patrol struck a civilian car instead, killing four people, including two women, near the northern city of Kirkuk.
A suicide car bomber also struck a police checkpoint in the northwestern city of Mosul, wounding 14 people, including four policemen.