Satyam has been struggling as clients cancel contracts
Satyam, the fraud-hit Indian IT firm, says local company Tech Mahindra is to buy a controlling stake in it.
Tech Mahindra put in the highest offer in sealed bids opened on Monday by Satyam's government-appointed board, a company spokeswoman said.
It agreed to buy a 31% stake at 58 rupees ($1.16; 79 pence) a share, then make a public offer to buy 20% more.
Satyam has struggled since founder Ramalinga Raju said in January that its profits had been overstated for years.
He and eight others are facing charges of criminal conspiracy, cheating and forgery for allegedly stealing millions of dollars from the company.
The government hopes that the sale of a controlling stake will restore investor confidence in Satyam, which has lost 80% of its market value since January.
Shares in both Satyam and Tech Mahindra rose strongly on the news. At one point, Tech Mahindra's shares were trading as much as 25% higher on the day before falling back.
Tech Mahindra beat Indian engineering firm Larsen & Toubro, which had already built up a 12% stake in Satyam and had been seen as the front-runner in the auction.
Satyam had been one of the biggest players in the booming Indian IT software market, supplying back-office services to firms from around the world, including General Electric and Qantas Airways.