About one in 10 people used an illicit drug last year, with marijuana and prescription pharmaceuticals the most common, according to new federal data.

The data was released Thursday by the Substance Abuse and Mental Health Services Administration. It found that about 10 percent of Americans in 2014 used an illicit drug in the past 30 days.

That percentage is higher than in every year from 2002 to 2013, the agency said. In 2013, for instance, the percentage of illicit drug use was 9.4 percent and in 2002 it was 8.3 percent.

The most common drug continued to be marijuana, where the percentage of marijuana users in 2014 who were 12 years or older was 8.4 percent of the population, greater than the 2013 figure of 7.5 percent.

The spike coincides with the legalization of recreational marijuana in Colorado and Washington.

Abuse of prescription painkillers continued to be the second most illicit product used by Americans. However, use of painkillers did not change from 2013 to 2014 at 2.5 percent of Americans 12 years or older.

That percentage is only a slight decrease from the 2.7 percent of users in 2002, the agency said.

Prescription drug and heroin abuse has received a lot of attention from lawmakers in recent years, especially from lawmakers in districts and states hit hard by what health experts call an epidemic.

Rounding out the top five illicit substances were tranquilizers, stimulants and cocaine.

Heroin came in eighth on the list at 0.3 percent, the same percentage of use in 2013 and 2012. The drug has received a lot of attention recently as prescription drug abusers often gravitate toward heroin since it is cheaper.

The data is based on an annual survey of U.S. residents aged 12 years or older. Nearly 68,000 responses to the survey were obtained by the agency.