(CNN) -- A prosecutor is dropping a charge against prominent Harvard University professor Henry Louis Gates Jr. after Cambridge, Massachusetts, and the city's police department recommended that the matter not be pursued.

Harvard Professor Henry Louis Gates Jr. was arrested last week on a charge of disorderly conduct.

In a joint statement, Cambridge and the police department said they made the recommendation to the Middlesex County district attorney and the district attorney's office "has agreed to enter a nolle prosequi in this matter," meaning that it will not be pursued.

Gates was arrested last week on a charge of disorderly conduct after a confrontation with an officer at his home, according to a Cambridge police report.

Charles Ogletree, a professor at Harvard Law School who is Gates' lawyer in this case, told CNN on Tuesday that Gates -- the director of Harvard's W. E. B. Du Bois Institute for African and African American Research -- had returned from China on Thursday to his Cambridge home and discovered his front door jammed.

'Moment of Truth-Black in America 2' Harvard professor, Henry Louis Gates, Jr. will join the countdown to Black in America 2, in his first exclusive interview since his run in with police at his home. Moment of Truth, live from Times Square.

Tomorrow 7 p.m. ET see full schedule »

He opened his back door with his key and tried unsuccessfully from inside his home to open the front door. Eventually, Gates and his driver forced the door open from the outside, Ogletree said.

The professor was inside for several minutes when a police officer, Sgt. James Crowley, appeared at his steps and asked him to step outside, the lawyer said.

According to his lawyer, Gates told the officer he lived there and showed him his Massachusetts driver's license and Harvard University identification card. The officer followed him into his house and said he had received a report of a possible break-in, the lawyer said. Gates grew frustrated that the officer was continuing to question him in his home and asked for the officer's name and badge number, Ogletree said.

The police report offers a different account of the incident.

Gates refused to step outside to speak with the officer, the police report said, and when Crowley told Gates that he was investigating a possible break-in, Gates opened the front door and exclaimed, "Why, because I'm a black man in America?" the report said.

"While I was led to believe that Gates was lawfully in the residence, I was quite surprised and confused with the behavior he exhibited toward me," he said, according to the report.

The report said Gates initially refused to show the officer identification, but eventually produced a Harvard identification card, prompting Crowley to radio for Harvard University Police.

Gates followed the officer outside and continued to accuse him of racial bias, the report said. After Crowley warned the professor twice that he was becoming disorderly, the officer wrote he arrested Gates for "loud and tumultuous behavior in a public space."

Ogletree said the professor was "very frustrated" but never touched or pointed at the officer.

He was released from police custody Thursday evening after spending four hours at the police station, Ogletree said.

All About Harvard University • Cambridge (Massachusetts)