The incident occurred after officers responded to complaints of a noisy dispute in an apartment in the town of Wettingen shortly after midnight, Aargau cantonal police said.
When they arrived a woman in the apartment initially seemed to be unthreatening but then she attacked officers, police said.
During a scuffle in a confined space, an officer’s service revolver went off, shooting him in the knee.
Another policeman from the city of Baden tended to the officer’s wounds until an ambulance arrived to transport him to the cantonal hospital in Baden.
The woman was handcuffed and two other people were arrested, police said.
She was brought before a medical officer and was subsequently transferred to a psychiatric hospital, police said.
The exact circumstances of the gunshot remain unclear, the force said.
The prosecutor’s office in Baden has launched a criminal investigation to clarify what happened.