Police say an undercover detective was exchanging narcotics with a suspect in his vehicle near gold's gym, when the suspect pulled a gun on the officer.
The suspect shot the officer, who returned fire and struck the suspect.
Now officials with the state division of criminal investigation,or DCI, are working with local authorities on the investigation.
DCI officials say the 25-year-old suspect was released from community medical center last night, and is now in custody.
They say a 22 year-old female suspect was also arrested in connection in this case.
According to the Montana department of justice, the undercover officer is in stable condition and was hospital today.