Texas Sen. Ted Cruz laid blame on President Obama Monday for the recent shooting death of a deputy sheriff in Houston – the Republican presidential candidate’s hometown – and said earlier in the day that the president had not done enough to target violent gun criminals after the Newtown massacre.

“Cops across this country are feeling the assault,” Cruz told reporters after a town hall meeting in Milford, New Hampshire. “They’re feeling the assault from the president, from the top on down as we see, whether it’s in Ferguson or Baltimore, the response of senior officials of the president, of the attorney general, is to vilify law enforcement. That is fundamentally wrong, and it is endangering the safety and security of us all.”

RELATED: Ted Cruz wages an all-out assault

The remarks come just three days after Deputy Sheriff Darren Goforth was shot “execution-style” on Friday at a gas station alongside a heavily trafficked road northwest of Houston’s city center. Authorities identified Shannon Miles, an African-American man whose criminal record includes trespassing and disorderly conduct with a gun, as the suspect during a press conference Saturday afternoon. Miles appeared in court Monday for an arraignment hearing.

“Cops across this country are feeling the assault … whether it’s in Ferguson or Baltimore, the response of senior officials of the president, of the attorney general, is to vilify law enforcement.” Sen. Ted Cruz (R-Texas) described racial discrimination as “embedded deeply in society,” though he typically shies away from speaking about such issues.

At the event in Milford, New Hampshire, Cruz also criticized the president for being “far too weak going after violent gun criminals,” and said that Obama missed an opportunity after the Newtown shooting “to target the bad guys.”

“Coming out of the Newtown shooting, the horrific school shooting, the president had an opportunity to actually work together, to say say let’s come together to target the bad guys, criminals, felons, people who are murderers – we’ll come down on them like a ton of bricks,” said Cruz. “But that’s not their focus … Their focus is on trying to undermine the Second Amendment rights of law abiding citizens.”

RELATED: How Cruz thinks he can win the GOP nomination

A longtime advocate for gun rights, Cruz enjoys an A+ rating from the National Rifle Association. Earlier this month, he also made a viral video that showed him making “machine gun bacon.” But his remarks Monday still came as something of a surprise, considering the fact that after the Newtown shooting in 2012, Obama launched an ambitious effort to overhaul the nation’s gun laws only to see every major proposal he championed fall apart on the Senate floor.

Cruz was one of 46 senators who voted against a bipartisan bill that would have expanded background checks for gun purchases – a measure expressly geared toward keeping guns out of the hands of “bad guys.” Cruz’s campaign did not respond to msnbc’s request for comment on how he, as president, would curb violent gun crime.