Private equity firm Veritas Capital and hedge fund Elliott Management are buying Athenahealth for about $5.7 billion.
The all-cash deal values the healthcare software maker at $135 per share.
That's a 12-percent premium over the stock's closing price on Friday.
Athenahealth shares rose on Monday.
Reuters editor-in-charge of mergers and acquisitions Greg Roumeliotis:
(SOUNDBITE) (English) REUTERS CORPORATE FINANCE AND M&A, EDITOR IN CHARGE, GREG ROUMELIOTIS, SAYING:
"This is a company that Elliott has been targeting for more than a year now. They've been calling for it to explore a sale. It's a company that has been in a little bit of a turmoil. It has a fairly stable business in that they provide healthcare software that is used by hospitals and doctors practices, but it has had few leadership changes and turmoil."
Those included a departure of Athenahealth's founder and CEO Jonathan Bush, a nephew of former U.S. President George H.W. Bush, after a newspaper report alleging he had assaulted his former wife 14 years earlier.
Also, former General Electric chief executive officer Jeff Immelt came on board as chairman.
Once the deal is complete, Athenahealth will merge with Virence Health, the former GE Healthcare unit that Veritas bought earlier this year.