The accusations are lurid: A former Yahoo Inc. software engineer says her boss slipped into her bed and coerced her to have sex, threatening her job and future if she said no.

To some, what happened next is even more sensational. Instead of attempting to diffuse the situation, Yahoo’s lawyers fired back publicly and aggressively in defense of Maria Zhang, Yahoo’s senior director of engineering, and backed her in a countersuit alleging defamation and intentional infliction of emotional distress.

Attacking the accuser in a sexual harassment case is a risky move. Whether Yahoo’s strategy will be successful could become more clear Tuesday, when Santa Clara County Judge Maureen Folan weighs a motion to dismiss Zhang’s cross-complaint under California’s anti-SLAPP law.

Experts on both sides of the bar say that Yahoo’s decision to play offense suggests three possible scenarios: Zhang is innocent and is outraged by the harassment accusations; Yahoo wants to reset a wave of negative publicity; or the company is trying to intimidate its accuser into dropping her claims.

“They either are incredibly adamant that they did nothing—that these accusations have absolutely no basis in truth, and there’s absolutely no basis for them to be proved,” said Sheryl Willert, a lawyer with Williams Kastner in Seattle. “Or, alternatively, they have determined that this is the appropriate tactic to throw the person off-balance.”

Willert was part of a team of attorneys that filed a defamation suit last year on behalf of TechCrunch CEO Michael Arrington after an ex-girlfriend posted allegations of sexual assault. (The suit was dropped after the accuser recanted.)

Yahoo also could be trying to send a warning to anyone else thinking of filing such a claim against the company, said San Francisco plaintiffs attorney Kelly Armstrong, who specializes in sexual harassment cases. She said the timing of Zhang’s counterattack, just days after being sued, is telling.

“They could wait and do it after they learn more about the case,” Armstrong said. “But they’re being very aggressive.”

The events that landed Yahoo in court began in February 2013, when the company acquired Zhang’s Seattle startup, Alike, which had developed a mobile app to recommend restaurants, stores and products according to user preferences.

Alike shut down immediately following Yahoo’s buyout, and its five employees, including engineer Nan Shi, transferred to Yahoo’s Sunnyvale office. Zhang and Shi moved into temporary Yahoo housing together, a living arrangement that Zhang suggested, according to Shi’s complaint.

The engineer claims Zhang coerced her into having sex multiple times by threatening her job and Yahoo stock. Shi reported the harassment to Yahoo’s human re­sources department in April, and Shi says Yahoo fired her in July in retaliation.

Shi sued last month, and Zhang filed her cross-complaint less than a week later.

Yahoo’s lawyers at O’Melveny & Myers say that Shi’s entire story is a lie. “Shi made these statements for the purpose of extorting money from Yahoo,” O’Melveny partner Eric Amdursky wrote in court filings.

The briefs air private settlement demands made by Shi and her lawyers from Sunnyvale’s Da Vega Fisher Mechtenberg.

“Shi repeatedly threatened to issue press releases regarding her allegations unless Yahoo capitulated to her demand to pay her more than a million dollars,” Yahoo’s lawyers wrote. “Shi carried out that threat.”

Yahoo’s defense strategy is one that some defense attorneys say they’ve dreamed of using. But it’s a gamble. The more aggressive the defense, the greater the likelihood the company comes across as a bully and undermines its own case, lawyers say.

“If it were successful, it would be something that would happen every day,” Willert said.

Da Vega Fisher partners Matthew Da Vega, Matthew Fisher and Ted Mechtenberg have already pounced on Zhang’s counterclaim. They say Zhang’s suit should be tossed out under the state’s anti-SLAPP law, which allows for quick dismissal of claims intended to stifle free speech and litigation activity.

“Defamation suits targeting women who report sexual harassment at the workplace exemplify the exact kind of meritless lawsuits California’s anti-SLAPP statute … seeks to prevent,” Shi’s lawyers wrote.

To sidestep the anti-SLAPP shield, Yahoo’s attorneys are attacking complaints that Shi made to third parties, not the accusations in her lawsuit. They say Shi sent emails in April to four Yahoo human resource staffers, claiming Zhang sexually harassed her and coerced her into a sexual relationship. She made the same complaints to two vice presidents in Yahoo’s mobile products department, and to at least three friends and family members outside of Yahoo, according to the company’s lawyers.

“In her motion, Shi asserts she made these reports as required by Yahoo’s sexual harassment policies and to seek a transfer ‘to a safe location,’” Yahoo’s lawyers wrote. “Nonsense.”

Regardless of their audience, Shi’s lawyers argue, her sexual harassment claims are protected as constitutional free speech involving what are “clearly issues of interest and importance to employers, employees and the general public at large.”

Sexual harassment in the abstract is a matter of public interest, Yahoo’s attorneys shot back, but Shi’s individual allegations are not.

Shi’s lead attorneys, Da Vega and Fisher, cofounded Da Vega Fisher Mechtenberg after they both left Cappello & Noel in 2012. Da Vega worked for Lieff Cabraser Heimann & Bernstein from 2001 to 2007.

A docket search shows that Shi’s case is the only sexual harassment claim either has filed in Santa Clara County Superior Court. They also filed a wrongful-death suit in an auto-related case last year in Santa Clara County. Before he started his own firm, Da Vega litigated about two dozen cases in the Northern District of California, most of which involved personal-injury claims.

Yahoo’s lead attorney, Amdursky, represents both the company and Zhang. He is managing partner of the firm’s Silicon Valley office and specializes in employment law. He’s defended several companies in gender discrimination and harassment lawsuits, including an investment bank and a cosmetics company, according to his profile on the firm’s website.

Yahoo is paying Zhang’s legal expenses, according to a company spokeswoman.

Lawyers with O’Melveny and Da Vega Fisher declined to comment on the case.

State law holds a company liable for a manager’s sexual harassment of a subordinate. Zhang’s problems became Yahoo’s problems when it took over her startup in a so-called acqui-hire deal, seemingly aimed at bringing Zhang and her four employees into the Yahoo fold.

Acqui-hires can pose risks because the deals happen so fast , said VLP Law Group founding partner David Goldenberg. The larger company tends to be in a rush to grab the startup before the competition.

“Very often these things happen very quickly, and maybe the buyer doesn’t have the time to do all the background checks and due diligence that it would in a normal candidate hiring situation,” Goldenberg said.

But Yahoo is hardly alone in its public battle against sexual harassment allegations. Silicon Valley venture capital firm Kleiner Perkins Caulfield & Byers was dragged into court by former investment partner Ellen Pao after the two sides failed to settle her sexual harassment, gender discrimination and retaliation claims. In June a former employee of dating app Tinder sued the company in Los Angeles County court for gender discrimination, sexual harassment and retaliation.

Some defense attorneys think it’s becoming more common for companies to fight back publicly against sexual harassment claims. Plaintiffs’ demands keep getting steeper, making settlements increasingly difficult and forcing more cases into the courtroom.

“Paying real money to try to sweep something under the rug … people aren’t going to necessarily do that,” said Wendy Lazerson, a partner in Sidley Austin’s employment group.

Especially since more defendants are deciding it’s unnecessary. Plenty of high-profile defendants, from executives to politicians, have fought sexual harassment allegations in the public arena and gone on to have successful careers, Lazerson said, which has diminished the shock value of the claims.

“Companies are more willing possibly to stand their ground,” she said, “and say … ‘We’re innocent and we’re going to defend ourselves. So go ahead.’”

Contact the reporter at mkendall@alm.com.