(Bloomberg) -- Investors were caught off guard by the sudden U.S. assault on technology giants this week, but behind the scenes, the industry’s biggest companies have been preparing for this moment of reckoning for months.

They’ve hired lawyers and built up their lobbying shops in response to antitrust investigations that have been well under way in the European Union, and which are just now getting started in Washington.

People close to the companies say they’ve long anticipated U.S. probes. And while these tech giants will need to bolster their defenses for added scrutiny closer to home, Amazon.com Inc., Alphabet Inc.’s Google, Apple Inc. and Facebook Inc. all have been working publicly and behind the scenes for months to make their cases for why they help competition, rather than harm it, and already have formidable teams in place.

As news of the federal and congressional probes roiled the companies’ shares this week, lawyers and executives working for Amazon, Facebook and Google were taking a wait-and-see approach, according to people familiar with the situation. Google hasn’t discussed with the Justice Department, which is set to investigate the company, details about what antitrust officials will focus on, one of the people said. The search giant, for its part, has in the past faced intense antitrust challenges in the U.S. and elsewhere, and already has a playbook for dealing with them.

Representatives of the companies have pointed fingers at each other as being the fattest targets for the government, even after news of the probes broke.

Spokespeople for Google, Amazon and Facebook declined to comment. Apple didn’t immediately respond to an email seeking comment. The government agencies themselves haven’t said what they intend to look at, and actual inquiries may not materialize.

Still, the move toward formal investigations, coupled with a new effort from lawmakers on the House Judiciary Committee to look at antitrust violations by the tech giants, is a clear escalation from the political rhetoric of the past year, led by U.S. President Donald Trump.

“Trump’s pretty clearly made some comments about this,’’ said Rob Atkinson, president of the Information Technology & Innovation Foundation, a think tank that lobbies against excessive tech regulation. “Over the next 18 months you’re going to see FTC and DOJ certainly be making a lot more noise.”

The action of dividing up jurisdiction itself shows the agencies are serious about investigating the companies in a real way, Atkinson said, and shows that criticism of the tech giants has filtered down to the policy level at agencies like the FTC and Justice Department.

The companies have been staffing their in-house legal teams with numerous antitrust lawyers who served in government. Amazon last year hired Bryson Bachman, a former counsel to Makan Delrahim, the head of the DOJ’s antitrust division. The former head of the division’s San Francisco office, Kate Patchen, left for Facebook last year.

Mountain View, California-based Google has long had a deep bench on antitrust. In-house lawyers include Rob Mahini, who came from the FTC in 2012, and Stewart Jeffries, who was an antitrust counsel for the House Judiciary Committee until 2011, giving them ample time to hone their arguments in favor of the internet giant’s business model.

They’ve also been stepping up spending in Washington. Google, Amazon and Facebook set company records for lobbying spending in 2018 as scrutiny of Big Tech intensified, according to Senate disclosures.

The tech giants were already coming under pressure for issues including Russian campaign meddling, data breaches, efforts to draft a tough federal privacy law and to make tech companies responsible for the content disseminated by their services.

Industry trade groups are another line of defense. As calls spread for tougher scrutiny of the industry, the Computer & Communications Industry Association, whose members include Google, Amazon and Facebook, hosted conferences on antitrust enforcement, and the organization publishes a regular newsletter promoting the industry’s view on competition.

Amazon, the Seattle-based leader in e-commerce, has worked mostly behind the scenes in an effort to contain the antitrust conversation, according to two people familiar with the matter. Amazon has opted against engaging in public Twitter spats with the likes of Senator Elizabeth Warren, a contender for the Democratic presidential nomination for 2020 who has proposed breaking up big tech companies as part of her campaign, one of the people said.

Instead, Amazon representatives visit lawmakers individually, often bringing small-business owners from that legislator’s state or district to speak about how Amazon is helping them grow, the person said. The message is consistent with its annual report about small businesses making money and creating jobs by selling products on Amazon’s marketplace. On Wednesday at a company conference in Las Vegas, Amazon’s retail chief disputed the idea that it unfairly competes with independent merchants by pointing out that its business selling private-label goods is much smaller than those of major rivals.

Google, the internet search and advertising leader, and No. 1 social network Facebook have also said that they help small businesses compete. In public conference calls and marketing materials, executives from the two firms routinely explain how their products are affordable tools meant to help mom-and-pops find and advertise to a broad range of people.

In May, Amazon sent out a report to politicians full of real-life anecdotes about the small businesses it helps and the startups it funds. When Facebook co-founder Chris Hughes wrote a column calling for his former company to be broken up, Chief Operating Officer Sheryl Sandberg went on TV to defend the social network.

In an interview on CNBC, Sandberg argued last month that breaking up tech companies wouldn’t address the underlying issues people have with technology, such as the spread of fake news or concerns about cybersecurity. She also warned that the U.S. shouldn’t break up its home-grown tech leaders, because it could give China an advantage in the race for tech dominance.

“While people are concerned with the size and power of tech companies, there is also a concern in the United States about the size and power of Chinese tech companies,’’ Sandberg said. “Those companies are not going to be broken up.’’

The FTC’s antitrust jurisdiction over Facebook comes as the commission already had the Menlo Park, California-based company in its sights -- the agency has been exploring the social network’s privacy practices as part of a consumer protection investigation. Any antitrust investigation from the FTC would operate completely separately from that privacy action.

IPhone maker Apple has already been fighting a major antitrust battle in the courts for years over whether the 30% fee it charges developers to sell software in its app store is an abuse of its power. It lost a skirmish in that fight in front of the Supreme Court in May, opening the door to consumers who want to sue Apple for having to pay higher costs based on those fees. This week, two developers filed an antitrust suit against Apple, claiming its App Store fees are too high.

Apple Chief Executive Officer Tim Cook has taken pains to distance his company from Facebook and Google, painting them as data-collecting behemoths engaged in surveillance to feed their advertising empires, while his own company is concerned simply with selling phones and services. Apple’s marketing and product announcements have highlighted its privacy claims in recent months.

Stricter rules on privacy don’t absolve Apple from potential antitrust concerns, but it could help the Cupertino, California-based company stay out of the larger political conversation about big tech, which often lumps together privacy, free speech, data collection and economic size, without much nuance.

That broader discussion is what concerns Atkinson, the think-tank president who also wrote a book called “Big is Beautiful,” defending American corporate giants.

“We’re in a panic phase -- an irrational panic,’’ Atkinson said.

--With assistance from Naomi Nix, Spencer Soper and Kurt Wagner.

To contact the reporters on this story: Gerrit De Vynck in New York at gdevynck@bloomberg.net;David McLaughlin in Washington at dmclaughlin9@bloomberg.net

To contact the editors responsible for this story: Sara Forden at sforden@bloomberg.net, ;Tom Giles at tgiles5@bloomberg.net, Alistair Barr

©2019 Bloomberg L.P.