Getting closer to the patient seems to be paying off at UnitedHealth Group.

Financial results released Thursday show the Minnetonka-based health care company surpassed the $3 billion mark in profit for the fourth consecutive quarter, prompting the company to boost earnings guidance for the year.

Second-quarter results beat expectations and were aided by better expense control within the company’s UnitedHealthcare business, which is the nation’s largest health insurer. The company also saw continued growth from a division that runs a growing network of clinics as well as centers for surgery and urgent care.

The clinic business is the clearest example of how UnitedHealth Group has been getting closer to patients in recent years, but company officials on Thursday described a related target to develop wide-ranging consulting and information technology (IT) contracts with hospitals. Earlier this week, UnitedHealth Group announced the first such agreement with California-based John Muir Health.

“This is a very important opening up of a new front, in terms of the opportunity to develop our interventions in the marketplace and, we believe, move to a more sustainable, high-quality, lower-cost health care environment,” said Andrew Witty, the chief executive of the company’s Optum division for health care services.

UnitedHealth Group, Minnesota’s largest company by revenue, employs about 320,000 people worldwide, said David Wichmann, the company’s chief executive, during a conference call with investors. The company employs about 18,000 people in Minnesota.

The push into health care fits with a trend for health insurers across the country.

In June, Eagan-based Blue Cross and Blue Shield of Minnesota announced a joint venture to help run the clinic division of Robbinsdale-based North Memorial Health Hospital. Two years ago, the national health insurer Aetna launched a joint venture insurance company with Minneapolis-based Allina Health system.

Aetna, meanwhile, is now a division of pharmacy giant CVS Health, which runs drugstores as well as a large pharmacy benefits manager (PBM). Another large PBM company, St. Louis-based Express Scripts, recently merged with the Connecticut-based health insurance company Cigna.

Optum runs its own PBM, and company officials on Thursday said the OptumRx unit added 11 million adjusted prescriptions during the second quarter compared with last year. OptumHeath, which includes the clinic business, saw second quarter revenue grow 20% to $7.1 billion.

A third Optum division called OptumInsight, which is focused on data, IT and analytics, announced this week the new contract with John Muir Health, a health system that includes two acute-care hospitals in suburban San Francisco. The agreement isn’t the first time UnitedHealth Group has worked as a significant consultant to hospitals, but it’s unique for being so comprehensive, said Eric Murphy, the chief executive of OptumInsight.

The parties did not disclose financial terms.

Nick Howell, a senior vice president at Optum, described the deal as a 10-year management-services partnership that lets John Muir Health use the company’s system for issuing and collecting medical bills. In addition, Optum will handle information technology services for the health system, including e-business and digital platforms, Howell said.

About 540 employees of John Muir Health will become Optum employees.

John Muir Health will use Optum’s analytics tools such as Symmetry, a product that helps hospitals define episodes of care for certain high-cost procedures and determine what sort of bundled payment they need in order to provide the service to patients without losing money. Such tools are important for hospitals and clinics as they enter into a newer type of payment relationships with health insurers, whereby care providers are at risk of excess expenses but can profit when care costs come in under budget.

With the new contract, Optum will be involved with care coordination and managing care for “delegated risk populations,” Howell said. Rather than remaining completely independent or merging with another health care system, the partnership model lets health systems like John Muir Health “access capabilities and scale and capital of a health services firm on the scale of Optum,” Howell said, “and have a new option for remaining independent.”

Witty, the Optum chief executive, said hospitals and health systems are interested in utilizing the information tools that UnitedHealth Group is using in its clinic business. Whereas Optum has been buying ambulatory care centers in recent years, company officials have repeatedly said they don’t want to own acute care hospitals.

During an investor conference in May, Wichmann called inpatient care a “nonstrategic” category for the company.

Overall in the second quarter, UnitedHealth Group posted a profit of nearly $3.3 billion — an increase of about $371 million, or 13%, ahead of last year’s results — on $60.6 billion of revenue. Adjusted earnings per share of $3.60 beat by 15 cents the expectations of analysts surveyed by Thomson Reuters.

In a note to investors, analyst David Windley of Jefferies LLC attributed the earnings performance to lower selling, general and administrative expense at UnitedHealthcare. Health insurance membership in the U.S. at the end of the second quarter stood at more than 43 million people, up slightly from last year.

UnitedHealth Group increased its full-year outlook for adjusted net earnings to $14.70 to $14.90 per share, up from the previous range of $14.50 to $14.75 per share. The company’s stock closed at $260.60 Thursday, down 2.2% for the day.