DraftKings and FanDuel, the two largest daily fantasy sports operators, have agreed to merge, the companies announced Friday.

The merger, pending regulatory approval, is expected to close in the second half of 2017. Until then, both sites will continue to operate under their respective brand names.

Terms of the agreement were not disclosed, but sources close to the negotiations told ESPN that it is basically a 50/50 split between the fantasy giants. Each company will have three seats on the board, with one independent director. At closing, DraftKings CEO Jason Robins will be the CEO of the new company, while FanDuel CEO Nigel Eccles will become the chairman of the board.

The name of the joint company has not been revealed. It will have headquarters in New York and Boston.

"We have always been passionate about providing the best possible experience for our customers and this merger will help advance our goal of building a transformational global sports entertainment platform," Robins said in the release announcing the agreement. "Joining forces will allow us to truly realize the potential of our vision, and as a combined company we will be able to accelerate the pace of innovation and bring a richer experience to our customers than we ever could have done separately."

"Being able to combine DraftKings and FanDuel," added Eccles, "presents a tremendous opportunity for us to further innovate and disrupt the sports industry. While both companies have accomplished much already, this transaction will create a business that can offer a greater variety of offerings, appealing to new users, including the tens of millions of season-long fantasy players that haven't yet tried our products."

The merger is expected to draw scrutiny, potentially from the Federal Trade Commission. FanDuel and DraftKings make up more than 80 percent of the daily fantasy marketplace, but they are looking to pool their resources to grow their customer base by tapping into the much larger season-long market, a source privy to the companies' strategy told ESPN. An estimated 40 million North Americans play only season-long fantasy sports, eight times more than the number of those who play daily fantasy.

The benefit of the merger to the consumer, an important test for regulators, will be increased overall competition in the marketplace, the source said. The source added that DraftKings and FanDuel will work together in a streamlined fashion to conquer regulatory hurdles, which have hampered both businesses. They believe it could further open the fantasy market to entrepreneurship.

Some smaller fantasy operators also view the merger as an opportunity.

A planned merger between DratKings and FanDuel has been called off. AP Photo/Stephan Savoia

"Prior to the tumult of the past year, FanDuel and DraftKings were well on their way to becoming multibillion-dollar pillar business[es] in sports," said Jeremy Levine, founder and CEO of DRAFT, a competing fantasy site. "There still will be massive business built in this space, but it won't be FanDuel or DraftKings individually. Due to the merger, the opportunity is now there for the few companies that were able to survive and strengthen in the past year."

In the meantime, with legal fees and regulatory costs mounting, the merger between DraftKings and FanDuel was seen as a necessity by some investors. Multiple high-volume players told ESPN they stopped playing because of the increasing "rake," the commission fee charged by the sites. Overall play on both sites was described as "soft" by players.

DraftKings and FanDuel each have approximately 320 employees.

FanDuel was launched in July 2009 in Edinburgh, Scotland, and rose to the top of the industry with an innovative, condensed version of traditional season-long fantasy sports. DraftKings came along three years later and quickly took aim at FanDuel, creating, at times, a hostile rivalry between the two leading operators and their CEOs.

Both companies attracted large investments from media conglomerates and venture capitalists. They formed partnerships with professional sports leagues. The NBA has equity in FanDuel; Major League Baseball and the NHL are partners with DraftKings, along with 28 of the 32 NFL franchises.

At their peak, the companies were each valued at more than $1 billion. But things changed in the fall of 2015.

Heading into last football season, the sites unleashed massive marketing blitzes, flooding the airwaves with commercials touting million-dollar prizes. The two companies spent an estimated $750 million combined on ads, marketing and related expenses in 2015.

The relentless advertising attracted a bevy of new users but also the attention of lawmakers and regulators.

The scrutiny intensified after a DraftKings employee won $350,000 playing in an NFL contest on FanDuel. There were accusations the employee used inside information. An investigation by DraftKings found the employee did not use internal information that potentially could have given him an unfair advantage in submitting his winning lineup, but the damage had been done, and a firestorm of controversy ensued.

In November 2015, New York Attorney General Eric Schneiderman sent cease-and-desist letters to DraftKings and FanDuel, eventually forcing the companies out of one of their most important states for several months. Alabama, Delaware, Hawaii, Idaho, Illinois, Mississippi and Texas joined New York in ruling daily fantasy violated state gambling laws.

FanDuel stopped operating paid contests in Texas, but DraftKings filed suit against Texas Attorney General Ken Paxton and continues to offer games in the state. Paxton's office said it would assess the impact of the merger on the pending litigation.

Both sites are still involved in litigation against Illinois Attorney General Lisa Madigan and also are contending with a consolidated class-action suit. They recently settled with Schneiderman over false advertising claims, agreeing to each pay $6 million. The settlement with Schneiderman, sources said, was one of the last hurdles before the merger could be completed.

Nine states have passed legislation clarifying the legality of fantasy sports in the past two years. With the new laws came increased regulatory costs in the form of licensing fees and taxes. They've taken a toll on the companies' finances and, along with legal costs, ultimately forced the merger, sources said.

The New York Times reported both sites were having trouble meeting their day-to-day financial obligations, and multiple sources told ESPN that DraftKings and FanDuel were months behind on paying vendors and lobbyists. The merger, upon approval, would allow the companies to split legal fees and regulatory costs. Without it, some questioned whether they would survive.

Up until recently, it seemed unlikely Eccles and Robins would be able to work together. They were known rivals and had different views on which direction to take the industry. DraftKings, for example, offers contests on golf and NASCAR, while FanDuel avoided those sports over legal concerns.

"They were the Jets and the Sharks," said Al Zeidenfeld, a high-level daily fantasy player and contributor to ESPN. "You think the Jets and the Sharks would form one super neighborhood gang? No."

Both platforms will remain separate and operational through the 2017 NFL season, while the deal is completed, the sites said.

ESPN senior writers Don Van Natta and Darren Rovell contributed to this story.