As a federal prosecutor, Gurbir Grewal hunted cybercriminals who plundered private data from companies like 7-Eleven, JCPenney, Dow Jones and other "corporate victims."

It kept him out of the public eye.

Now as New Jersey's attorney general, the 45-year-old Grewal has found himself on a public stage, defying the Trump administration's almost daily dismantling of Obama-era policies and other long-enshrined constitutional safeguards.

Grewal, the first Sikh in the nation to serve as a state attorney general, doesn't see himself as just the state's chief law enforcement official. Preventing ordinary citizens from becoming Trump-era victims is now a top-priority task.

"New Jersey is being presented with a lot of challenges from the [Trump] administration,'' Grewal said in a recent interview in his Newark office. "We have to stand up. Obviously, the federal government is not standing up for us."

In the recent history of New Jersey attorneys general, Grewal is a rare figure, an activist who wields the power of the office in a concerted, politically progressive push-back against a right-wing agenda.

That has also made him a target: A furor erupted last month when two talk radio hosts mocked him as "turban man" on an afternoon show. But Gov. Phil Murphy made it clear that his attorney general should expect to play a highly visible role and have the spine to tangle with Trump.

“We need an attorney general unafraid to join our fellow states in using the law to protect all New Jersey residents," Murphy said when he introduced Grewal last December.

Grewal wasted little time carrying out the mandate. Virtually every time Trump roiled the landscape with another executive order or a regulatory rollback, Grewal's office hit back with a lawsuit, a brief, or a letter.

When Trump sought to kill a program that halted deportations of so-called Dreamers, children brought to the United States by undocumented immigrants, Grewal backed a New York-led lawsuit seeking to reverse Trump's decision.

New Jersey joined a multistate lawsuit challenging the Trump administration's policy of separating children at the border. Grewal's department filed a brief backing Hawaii's effort to overturn Trump's third attempt to impose a travel ban on Muslim-majority countries.

Dreamers:NJ attorney general attends hearing on DACA suit in Texas

Immigration:New Jersey joins coalition challenging Trump's third travel ban

Environment:Phil Murphy administration vows to fight Trump's plan to weaken car emission standards

His office has pushed back on the Environmental Protection Agency's high-speed shredding of long-held regulations. And in July, Grewal's office filed suit seeking to strike down the $10,000 limit on state and local property tax deductions, a key feature of Trump's tax overhaul and one that will pinch New Jersey taxpayers.

Grewal is hardly the only state attorney general clashing with Trump in the courts. More than 20 other states have joined the charge in slowing the Trump agenda, convinced that Congress won't stand in his way. Grewal goes as far as describing Congress as "complicit" with Trump's dismantling.

And Grewal has grabbed headlines with swift action unrelated to Trump. Last week he created a task force to investigate claims of abuse in the Catholic Church and raised the possibility of subpoenas and a grand jury probe.

Yet while the Trump attacks have raised Grewal's profile, that has also raised some criticisms. The steady stream of headlines has fueled chatter that the legal war on Trump is a less-than-subtle effort by Murphy to burnish his national reputation as a progressive force, possibly with an eye to running for president in 2020.

Investigation:New Jersey attorney general to investigate sex-abuse allegations among Catholic clergy

Traffic:Attorney general calls Leonia street closures illegal, mayor defends ordinance

Douglas Steinhardt, the state Republican Party chairman, captured that suspicion last month when he called on Murphy to "stop wasting taxpayer money on frivolous lawsuits engineered to garner national headlines by pitting himself against President Trump." Steinhardt punctuated his point with an online petition calling on Murphy to "fix New Jersey first."

Grewal, in the interview, dismissed any suggestion that he was acting as a political instrument for Murphy. Grewal said he sees "eye to eye" with Murphy on issues such as civil rights, immigration, consumer protection and the environment. When Trump takes aim at those issues, Grewal's office consults state agencies and the governor's office before responding.

"If there is an attack on New Jersey in any one of those [issues], we take our cues from the administration in D.C.,'' he said. "If it affects New Jersey, then we are going to stand up, if the federal government is standing down."

Yet the Murphy and Grewal relationship is almost the complete opposite of Trump's own relationship with his attorney general, Jeff Sessions. As Trump continued to publicly humiliate Sessions late last month, Murphy saluted Grewal after a federal judge in Texas refused to invalidate the program that shields undocumented children from deportation. New Jersey was a defendant in the case.

Cybercrime fighter

To his former colleagues, Grewal is about the least likely person to serve as a résumé-burnishing tool for an ambitious governor. Grewal joined the U.S. Attorney's Office in 2010 after serving a three-year stint in the Eastern District of New York in Brooklyn.

In Newark, Grewal was known as an apolitical, nose-to-the-grindstone prosecutor. He led the prosecution of an international hacking ring responsible for the largest known breach of corporate data. He also spearheaded the 2012 prosecution of Eliyahu “Eli” Weinstein, the Lakewood man accused of masterminding a $200 million fraudulent real estate investment scam.

Montclair lawyer Judith Germano, a former federal prosecutor who worked closely with Grewal in the Economic Crimes Unit, said she had no inkling of Grewal's politics.

"His decisions were always made and the discussions we always had were [based] on: 'What's the right thing to do?' And in my long experience with him, he has never wavered from that," said Germano, a senior fellow at the New York University Center for Cybersecurity.

"I would not see him ... taking a position on political soapboxing,'' she said. The fact that a Republican Gov. Chris Christie named him Bergen County prosecutor in 2016 is also a measure of Grewal's apolitical reputation, she noted.

Paul J. Fishman, the former U.S. attorney for New Jersey, said Grewal was shaped by the progressive ethos of the Obama-era Justice Department of protecting "underserved and marginalized communities." Trump represents a sharp pivot from that tradition.

"I don't think he likes or respects that the machinery of the federal government is driving people apart rather than bringing them together,'' said Fishman, who was appointed by President Barack Obama in 2009. "And I think he recognizes that he is in a position that he can do something about that, not because he's anti-Trump, but because he doesn't like the policies and doesn't think they are legal."

Grewal, a Jersey City native who lives in Glen Rock, says his progressive view is rooted in his faith.

"Sikhism believes in radical egalitarianism,'' he said. "We are progressives in the sense that we are taught to fight for justice whereever we see it and however we see it,'' he explained. "Those are values that fit perfectly in line with being a public servant."

Grewal says he has moved past the "turban man" controversy, which led to the 10-day suspension and apologies of the New Jersey 101.5 hosts, Dennis Malloy and Judi Franco. He said he was more worried that the comments might provoke a violent attack.

"Comments lead to conduct,'' he said. "And that's what I'm always afraid of as a law enforcement officer. I don't know who is so close to the edge that they need that slight nudge to do something physical."

Article continues below video.

Rebuilding a reputation

As attorney general, Grewal commands the Department of Law and Public Safety, a sprawling workforce of 7,600, which includes more than 450 attorneys prosecuting polluters, white-collar criminals, drug gangs and corrupt politicians. It also oversees the state police and its 2,800 troopers.

To some longtime veterans, the agency has lost some of its luster earned in the 1970s as a corruption-busting force. Observers have seen the clout of its Criminal Justice Division weakened and bureaucratized over time.

Over the last 25 years, the department was tainted by the state police racial profiling scandal in the late 1990s and the bungling of a high-profile corruption investigation in Burlington County in the early 2000s. During the Christie administration, the department retreated into an understaffed dormancy. Under Christie, the department was best known for reaching a controversial $225 million settlement with Exxon – a fraction of the $3 billion originally sought – and for allegedly suppressing an investigation of corruption involving the Hunterdon County sheriff's office.

At a Newark news conference where he announced plans to seek damages from six toxic sites, Grewal noted that environmental cases like these all but vanished over the Christie years.

Some veterans are hoping Grewal will lead a long-overdue overhaul.

Polluters beware:Murphy wants your money

Guns:New Jersey attorney general and defense firm in legal firefight over 3D-printed guns

Edwin H. Stier, a former federal and state prosecutor who led one of the state's largest crackdowns on organized crime and corruption after a series of scandals in the late 1960s, said it was time for a "clean slate" of the department's crime-fighting units.

"I wouldn’t make any assumptions about it. I would go back and look at their original purpose. I would want to make sure they are capable of meeting those goals,'' Stier said.

Grewal said the Trump pushback overshadows work on other priorities, such as improving community and police relations and grappling with the opioid epidemic. In June, his department steered 146 low-level drug offenders into a drug treatment programs.

The department also teamed up with the U.S. Marshal's Office last month in a fugitive sweep in four cities, leading to the arrests of 166 people, including 61 for gang-related offenses. Grewal also plans to launch a new unit within his office that will target public corruption and bolster investigations of of police-related shootings and civil rights complaints. Grewal is expected to unveil his plans as early as Monday.

But there is little doubt that Trump will continue to absorb his energies and grab the spotlight.

"I have three little kids,'' Grewal said. "I have no doubt that two decades from now, or a decade and a half from now, they are going to ask me, ‘Dad, what did you do when Trump was president?' And I want to be able to say I did the right thing."