The two firms said in a statement on Tuesday that they had reached an agreement that prices each Spirit share at 115p.
Spirit, which runs chains such as Chef & Brewer, Fayre & Square and Flaming Grill, is split into more than 750 managed pubs and 450 leased pubs.
Spirit shareholders will receive 8p in cash and 0.1322 new Greene King Shares for each of their current shares.
Magners cider maker C&C Group tried to gate-crash the deal last week but a preliminary approach for Spirit, believed to have been pitched at around 110p a share, was rejected by the pubs company.
Greene King said it expects the takeover to achieve cost synergies of at least £30mln per annum.
Rooney Anand, Greene King chief executive, said: “This offer represents a fair price for Spirit's high quality estate that fits well within the Greene King portfolio on both a brand and geographic basis, expanding our presence in the attractive London and South East area.”
Spirit chairman Walker Boyd, added: “The combination with Greene King will take us to the next level, creating the UK's leading pub group with further opportunities for growth and accelerating progress towards our objectives of delivering attractive returns for investors."