UnitedHealth, the largest U.S. health insurer, on Tuesday reported second-quarter medical costs slightly higher than Wall Street expectations, sending its shares down 4 percent and weighing on the rest of the sector.

UnitedHealth is the first health insurer to report earnings, and Wall Street investors took their cue from the slight costs miss to sell shares in Anthem, Cigna, and Humana.

The Trump administration has begun to issue new rules and regulations to roll back some of the insurance coverage expansion that took place with Obamacare, former President Barack Obama's 2010 health law, and implementing new laws. UnitedHealth said it expects the debate to continue into 2019.

The government also wants to bring down high drug prices, including examining if the role of pharmacy benefit managers like UnitedHealth's Optum contributes to those price increases. The company said it is trying to lower prices on drugs for customers.

UnitedHealth's medical loss ratio, or the percentage of premiums paid out for medical services, was 81.9 percent in the quarter, short of the consensus estimate of 81.8 percent, according to healthcare investment bank Leerink.

While the ratio was actually better than the 82.2 percent a year ago, the company typically beats Wall Street estimates.

Investors are focusing on the cost trend and that's why other insurer shares were down and hospital stocks were up Tuesday, Michael Newshel, an analyst at Evercore ISI, said.

"Management said (the) costs trend is still tracking in line with what they priced for and guided to, but expectations were elevated for outperformance on the medical loss ratio metric," he added.

The stock, up nearly 17 percent this year, fell 3.5 percent to $248. Anthem was down 1.7 percent, or $244.12, to $242.41, Cigna was off 1.9 percent to $169.70 and Humana decreased 2.4 percent to $308.25.

UnitedHealth Chief Financial Officer John Rex said on a conference call with analysts that the medical cost ratio was within expectations and sees a range of 81.5 percent, plus or minus 0.50 percentage points, in 2018.