WASHINGTON TOWNSHIP, Mich. — President Trump capped a volatile week of progress and setbacks with a long, angry blast at Democrats, the news media, immigration laws and other favorite adversaries on Saturday night as he sought to reinforce his position as a Washington outsider victimized by a system threatened by him.

Mr. Trump flew here to hold a rally with fervent supporters as a bit of counterprogramming to the annual dinner of the White House Correspondents Association, which he once again skipped. It was the second consecutive year he spurned mingling with politicians and members of the media to showcase his support outside the capital. “I’d much rather be in Washington, Mich.,” he told the crowd.

“Is this better than that phony Washington White House correspondents dinner?” he asked, dismissing the black-tie affair in favor of the signature red hats in the Washington Township crowd. At the same time he was speaking, senior administration officials, including Sarah Huckabee Sanders, the White House press secretary, were attending the lavish event in the other Washington, which was billed as supporting the First Amendment.

In a rambling, stream-of-consciousness speech that lasted for an hour and 15 minutes, Mr. Trump made a point of singling out his latest top target, Senator Jon Tester, a Democrat from Montana who helped thwart the cabinet nomination of the president’s physician. Picking up on Twitter attacks earlier in the day, Mr. Trump accused Mr. Tester of unfairly smearing Ronny L. Jackson, the doctor who withdrew from consideration as secretary of veterans affairs, with false allegations of misconduct.