KANSAS CITY, Mo. (Reuters) - A man who put residents of Kansas City, Missouri, on edge for weeks in 2014 by shooting at cars on area highways pleaded guilty on Tuesday to 20 felony charges and will serve 30 years in prison, officials said.

Mohammed Whitaker, 30, of Grandview, Missouri, pleaded guilty to 10 counts of unlawful use of a weapon by discharging it at a motor vehicle and 10 counts of armed criminal action, said the office of Jackson County Prosecutor Jean Peters Baker.

"Today, our community can rest knowing that the person who terrorized them in 2014 on our freeways will be sent to prison for a 30-year sentence,” Baker said in a statement.

Whitaker's attorney, Jonathan Bailey, could not immediately be reached for comment.

In a series of seemingly random attacks, Whitaker was charged with opening fire at cars on highways in and around Kansas City with a .380-caliber handgun, injuring three people, authorities said at the time of his arrest in April 2014. No motive was provided.

Whitaker fired from his own vehicle by positioning it in the blind spots of his targets, authorities have said.

A major break in the investigation came when someone looking for a lost cellphone along a highway reported finding a Walmart bag with an empty .380-caliber shell casing and empty bullet box, which police said bore Whitaker’s fingerprints, authorities said.

After police got a tip on Whitaker’s license plate number, he was followed for several days before being arrested at his apartment near Kansas City wearing a dark hooded sweatshirt and sunglasses, according to authorities.