Ambulances are parked outside the emergency room at Good Samaritan Hospital in San Jose, California.

HCA Healthcare shares jumped on Tuesday after the company reported third-quarter earnings and revenue that beat Wall Street's expectations.

The Nashville-based hospital behemoth also raised its earnings and revenue guidance for 2018.

The stock was up as much as 3 percent in premarket trading before trimming some of those gains. Shares of HCA were marginally lower in midmorning trade.

HCA reported third-quarter earnings of $2.15 per share on revenue of $11.45 billion. Wall Street expected earnings of $1.89 per share on revenue of $11.29 billion, according to FactSet.

The company expects revenue for the year to be between $46 billion and $47 billion. Earnings per share is expected to be between $9.05 and $9.45 per share.

During the quarter, same facility admissions increased 3.1 percent, while same facility emergency room visits declined 0.4 percent.

The hospital operator, which specializes in trauma and surgical centers, has been aggressively expanding its ambulatory footprint and has purchased a string of hospitals in recent years, offsetting the slow down in admissions.