Payment systems company ACI Worldwide Inc. said Monday that it reached a deal to buy S1 Corp. for about $516 million in cash and stock, after again boosting the cash portion of its offer.

ACI, which is based in New York, had been trying to buy payments software provider S1 since late July, but its previous advances had been rejected.

Shares of ACI fell $1.62, or 5.9 percent, to $25.92 in midday trading Monday. S1 shares added 7 cents to $9.24.

Under the terms of the deal announced Monday, the Norcross, Ga. company's shareholders will receive $6.62 in cash and 0.1064 shares of ACI common stock for each S1 share. That values S1 at about $9.55 per share based on ACI's Friday closing stock price.

Based on S1's about 54 million outstanding shares as of July 27, the offer is worth $515.7 million.

The boards of both companies have approved the deal. S1 shareholders have until Oct. 31 to tender their shares.

ACI said that it expects to cut about $30 million in annual costs because of the acquisition, and that the deal will add to its full year earnings starting in 2012.

ACI initially offered to buy S1 in July for $540 million, or $9.50 per share, in cash and stock. It has raised the cash portion of its bid as its stock price has dropped 23 percent since late July.

S1 had rejected ACI's bid, saying in early August that it preferred a deal with Israeli bank services company Fundtech Ltd. But in September, private equity firm GTCR beat out S1, buying Fundtech for $352.7 million in cash.

ACI tried again with a higher cash offer in late August, taking it to S1's shareholders. The company's board had advised shareholders not to accept that offer.