once considered replacing as its default search engine in private browsing mode on its products in favor of DuckDuckGo, according to recently unsealed testimony by the rival search CEO.

"Our take was that they were actually really interested in this," DuckDuckGo CEO Gabriel Weinberg said, according to a transcript viewed by CNBC of the testimony in federal court last month. "The people we were talking to were generally DuckDuckGo users themselves interested in privacy."

Weinberg, testifying as part of the Department of Justice's antitrust case against , said DuckDuckGo and Apple had about 20 meetings and phone calls over the course of the negotiations, which lasted from about 2016 through 2019. Throughout that period, Weinberg said Apple's contract with Google to be the default search engine on its Safari browser "was often the elephant in the room."

The government is trying to prove that Google's exclusive contracts with phone and browser makers unfairly locked out rivals from the general search market by depriving them of distribution. Google has denied that its actions violated antitrust law.

DuckDuckGo, which is privately held, makes a privacy-focused search engine that competes directly with Google, as well as other privacy products that seek to limit how websites can track consumers across the internet.

DuckDuckGo first got a response from Apple about its idea to become the default search engine in private browsing in 2016, Weinberg said. DuckDuckGo claims its search engine greatly reduces the amount of tracking that is still possible in other search engines, even while on private browsing mode.

In 2017, DuckDuckGo was able to secure a meeting with Craig Federighi, a senior vice president, at Apple's headquarters in Cupertino, California to discuss its proposal. DuckDuckGo presented Apple executives with data about what Apple users expect from private browsing mode, which Weinberg said he'd thought "was pretty compelling."

Weinberg's team said they could "make DuckDuckGo the best search option on Apple devices for Apple users by integrating their content into search modules" including Apple News, Maps, Music and TV.

Weinberg said he left the meeting with the impression that "it went very well."

"I've pitched lots of things to Apple over the years," Weinberg testified. "If there's no interest, their move is basically silence."

DuckDuckGo executives returned to Cupertino the following summer for another meeting and presented visuals of how the product would look once its search engine was integrated into Apple services.

Weinberg said his "impression was that they were really serious" about the idea "potentially for the next year's release." He said that Adler asked them "to come back basically as soon as possible to brainstorm what privacy integrations could look like."

Separate recently unsealed testimony from Apple's side tells a somewhat different story.

John Giannandrea, Apple's senior vice president of machine learning and artificial intelligence and a former Google executive, joined the company in 2018. He testified that he wasn't aware of Apple considering the search default switch.

Still, he went on to describe discussions with other Apple executives about the potential drawbacks of such a proposal. Giannandrea worried DuckDuckGo's "marketing about privacy is somewhat incongruent with the details," since he thought the company would have to share some user information with due to its arrangement to receive search information from Bing.

DuckDuckGo says in its that it prevents "our hosting and content providers from creating a history of your searches and browsing."

In September 2018, DuckDuckGo returned to Apple headquarters to discuss integration, Weinberg testified. Apple "expressed they were really considering this for the 2019 release," and Weinberg then realized they still had some lingering concerns. In particular, Apple realized it need to figure out how to resolve issues tied to its Google contract, Weinberg testified.

Sometime after the 2018 holidays, DuckDuckGo received documentation from Apple showing what its revenue share would be if it were the default. DuckDuckGO estimated its market share "would increase multiple times over" just by becoming the default in private browsing mode.

By the summer of 2019, DuckDuckGo began to understand the partnership would not happen. Apple didn't announce the integration during its Worldwide Developers Conference in June. Four months later, following a meeting, Weinberg's takeaway was that the deal was "dead."

DuckDuckGo had also pitched Samsung, Mozilla and Opera on being the default option in their private browsing modes, but was not able to reach a deal with any of them. The company eventually stopped pursuing this model because it concluded "That each of these companies' Google contract was the key thing preventing us from getting a deal done with them."

WATCH: