Gov. Jerry Brown had a tough call with the president’s National Guard request. Photo: Sina Schuldt / Abaca Press 2017

Photo: Sina Schuldt / Abaca Press 2017

Gov. Jerry Brown had a tough call with the president’s National Guard request.

Gov. Jerry Brown found himself caught in no man’s land when it came to deploying the California National Guard to make President Trump happy. He still managed to come out a winner.

Brown knew he had no choice but to go along with Trump’s request to call out the Guard, even though the waves of illegal immigrants that the president cited as a reason exist mainly in his head. Trump held the ultimate weapon — he could federalize the state Guard, removing it from Brown’s control. It would be a drastic step, but it’s easy to imagine Trump doing it.

But Brown was not about to just say yes and spend his final months in office being hounded by sanctuary protesters every time he showed his face in public.

So he did what he always does: He gave each side a little bit, without actually giving either one the win.

In this case, he agreed to deploy Guard troops, but only on the condition that they not participate in any immigration law enforcement. Drugs, guns, human trafficking — that’s what the Guard will be looking for.

At first it looked like it might backfire, as Trump tweeted his thanks to “Jerry” for “doing the right thing.” Effusive praise wasn’t exactly what Brown had in mind.

Fortunately, it dawned on Trump over the next few days what the governor had actually agreed to. By last week the president was back to his usual insulting self — which Brown doubtless welcomed — even as his administration worked with the state to make the California Guard deployment happen.

This is why Brown has lasted so long in politics and done so well. He can say “yes” and “no,” all in the same sentence.