After decades of decline, the number of U.S. workers testing positive for illicit drugs at the workplace has increased slightly. Last year is the third consecutive increase after 10 years of declining rates of usage.

A study by drug testing company Quest Diagnostics finds a slight increase in the number of U.S. office workers and "safety-sensitive" workers, including pilots, subway engineers, ship captains, and truck drivers, who test positive for illegal drugs.

According to millions of test conducted in 2015, 4 percent of total worker drug tests were positive. For the general workforce, positive tests rose to 4.8 percent in 2015 from 4.7 percent in 2014. Positive tests for safety-sensitive employees rose to 1.8 percent from 1.7 percent.

While many positive results were for prescription drugs, the majority of the tests were for illegal drugs, the Wall Street Journal reports.

Quest Diagnostics says some of the increase is due to improvements in its detection technology, which can now better detect drugs that do not stay in a person's system as long, including amphetamines, cocaine and heroin.

The study was sourced from over 9.5 million urine tests and reflected the nation's rise in drug use. According to a 2014 report from the U.S. Department of Health and Human Services, 10 percent of Americans over the age of 12 used illicit drugs in the 30 days, marking the highest percentage recorded since the early 2000s.

Still, data from last year does not top drug usage in America's history. Back in 1988, Quest Diagnostics found that 13.6 percent of its drug tests came back positive for illicit drugs, the Wall Street Journal reports. That same year, Ronald Reagan enacted the Drug-Free Workplace Act and mandated drug testing for federal employees. Shortly after those changes, employers started using drug tests as filter for job candidates.

In 2012, positive test results hovered around a low of 3.5 percent, but started to inch back up in 2012. Interestingly, in states like Colorado and Washington, the number of positive test results for marijuana did not increase from years before.

Quest says the bad news is the rise in positive tests for heroin and prescription pain killers. As the country has found itself in the middle of an opioid epidemic, where more people overdose and die from legal opioids than from car accidents, the number of positive results for heroin has increased 146 percent for the general workforce and 84 percent in safety-sensitive workers between 2011 and 2015.

As doctors whittle down the number of prescriptions for opioid pain killers to patients, the number of heroin users is climbing, Quest found.

As for employers, Todd Wulffson, a partner at California-based employment and labor law firm Carothers DiSante & Freudenberger, has told Inc. that he tells his clients to follow a simple rule of thumb: When it comes to drug use at work--whether it is an employee with cancer smoking marijuana or one popping Xanax to deal with anxiety--Wulffson suggests you should adopt a simple, straightforward company policy that reads something like this: "We don't allow the use of, the possession, or being under the influence of any illegal drug in the workplace. 'Illegal drug' is defined as 'the abuse of over-the-counter medication, prescription medication, medical marijuana, and alcohol."