Anna Ramirez was a detective who worked in the Major Crimes Unit of the Gotham City Police Department. Before working there with James Gordon, she was investigated by Harvey Dent for corruption but never convicted.
She worked with Gordon following the mob's money, and investigated a series of bank robberies committed by the Joker. Her mother was in the hospital, and the bills began to pile up so she began working with Sal Maroni for extra money. The Joker began killing public figures in an attempt to find the identity of Batman, and Harvey Dent gave himself up as Batman. After he escaped an assassination attempt by the Joker, Ramirez put Dent into the back of a car with Michael Wuertz, who was also working for Maroni. Ramirez then picked up Rachel Dawes and delivered her to Maroni, not knowing that they would put her in a room full of oil barrels and blow her up.
The Joker then threatened to blow up a hospital if Coleman Reese was not killed, and Ramirez's name was flagged as her mother was at risk. Gotham General Hospital was destroyed and Harvey Dent escaped, going after the people responsible for Rachel's death. Maroni gave up Ramirez's name, and Harvey took her at gunpoint and made her lure Gordon's wife, son and daughter to Harvey's trap. Dent then flicked his coin to see if Ramirez would live or die - the undamaged side landed upwards, so Dent just knocked her out and she is later found bound and gagged. She is last seen when Gordon smashes the Bat-Signal (in order to keep the charade that Batman was responsible for Harvey's death and the killings beforehand). It is unknown what happened to her after the events of The Dark Knight, it is likely she left the Major Crimes Unit.