Frederick City Police say they were called to the 100 block of Baughmans Lane around 8 a.m.
Officers say the suspect had been given a ride to that location from the Spring Ridge area by a Yellow Cab of Frederick taxi.
Police say the suspect assaulted the taxi driver and tried to steal that taxi. The taxi driver fought off the suspect, who then stole a nearby vehicle and took off, according to police.
The suspect has been identified Ernest Anthony Cross, 26, of Monrovia, Md. He's been charged with attempted carjacking, second degree assault, motor vehicle theft, and theft of less than $100.
Cross was taken to the Frederick County Adult Detention Center.
Copyright 2016 Nexstar Broadcasting, Inc. All rights reserved. This material may not be published, broadcast, rewritten, or redistributed.