Real estate listing aggregator Zillow has agreed to purchase one of its biggest competitors, Trulia. The $3.5 billion deal, which has been approved by both companies' boards, will close sometime next year pending regulatory approval.

As per the agreement, Trulia shareholders will receive 0.444 shares of Class A common stock in Zillow in exchange for each Trulia share they own. Current Zillow shareholders will receive one comparable share of the combined company.

Once closed, existing Trulia shareholders will own approximately 33 percent of the combined company while current Zillow shareholders will represent the remaining 67 percent. The stock swap represents a 25 percent premium over Trulia's closing price of $56.35 last Friday.

Despite the merger, the two companies will continue to operate as separate identities. Trulia's CEO, Pete Flint, will maintain his title and report directly to Zillow chief Spencer Rascoff.

For those unfamiliar, Trulia and Zillow are among the top destinations for home buyers, sellers, renters and real estate professionals. Trulia reported a record 54 million unique visitors last month while Zillow was able to attract 83 million uniques during the same time period.

Both firms primarily consider themselves media companies, generating the majority of revenue through advertising sales to real estate professionals. It's an angle they'll likely use in their pitch to regulators who may question how the merger would affect competition in the marketplace.

As of writing, Trulia stock is up more than 18 percent on the news while Zillow's share value is up 2.32 percent.