SALEM — Over last Labor Day weekend, when Democrats were under the mistaken belief they would win the White House and Senate, Representative Seth Moulton sat down to pen a note that departed from his renegade brand.

Three pages of gushing words to Nancy Pelosi, the House minority leader, thanking her.

For everything.

For the plum House Armed Services Committee assignment she’d given him (“people at home are thrilled,” he enthused). For the chance to sell the Iran nuclear deal on TV (“the opportunity you gave me to exercise that on a national stage did not go unnoticed,” he wrote). Even for the intern she’d helped secure (“I don’t know where we’d be without Dennis — he’s extraordinary!” Moulton exclaimed).

Advertisement

“The bottom line is that I’m proud to be in public service, but I wouldn’t be able to do the job as well without your help,” he concluded, laying the groundwork for a pitch to win a coveted spot on the House Transportation Committee as well.

Shortly after he sent the note, the political landscape shifted, and so did Moulton’s tone. After a devastating November election for Democrats left Republicans in control of all branches of government, Moulton became a loud voice opposing Pelosi’s leadership, joining 62 other House insurgents who voted to replace her in November.

Last week, as the Democratic Party reeled from another loss in a hard-fought House race in Georgia — giving Democrats an 0-for-4 record in House special elections for Republican-held seats this year — Moulton again joined a band of House members demanding that Pelosi, 77, step aside.

Loyalties in Washington are fluid, but even by the Capitol’s standards, Moulton’s change in posture is striking. The September note included no hint of the simmering dissatisfaction he said he was feeling at the time.

Pelosi, through a spokesman, declined to comment.

Advertisement

Moulton, 38, said that he stands by his letter, which the Globe obtained from a former aide to a member of the Massachusetts congressional delegation.

“Never once do I thank her for her leadership,” Moulton said, over lunch with his new fiancee and a Globe reporter after marching in a gay pride parade in Salem, part of his North Shore district. “If Pelosi was looking for praise of her leadership in that letter, it wasn’t there.”

“There is no intellectual dissonance at all,” he continued. “Generally when you ask for something, you’re polite and thankful.”

* * *

Polite and thankful are not the first two words typically used to describe Moulton. Harvard-educated and one of roughly two dozen veterans from wars in Iraq or Afghanistan now serving in Congress — he has established himself as a Democratic disrupter, someone with disdain for Washington’s customs and hierarchies and eager to make his own mark. Indeed, he captured his seat in 2014 by unseating an entrenched Democrat and Pelosi ally, John Tierney, in a divisive primary.

Pelosi supported Tierney in 2014, even coming up to the district to appear next to him at a town hall-style event. The ties go even deeper: Her daughter Christine worked for Tierney as a chief of staff.

Moulton’s fans in his district admire the fresh outsider approach and applauded him repeatedly in the Salem parade last week. They want to see someone shake up Washington and snap the Democratic Party out of what to them seems like a political stupor, oblivious to the hunger for change that Donald Trump so successfully tapped into in 2016.

Advertisement

But Moulton’s brash attitude can easily come across as opportunistic, and it remains to be seen if his penchant for peacocking will be effective in the long run in a legislative body that still relies to a certain extent on clubby rules.

Beyond garnering a burst of headlines, it’s unclear what his challenges to Pelosi can accomplish, given the continued support she enjoys within the Democratic caucus.

“Politically Seth is trying to build on the reputation that he has,” said Mary Anne Marsh, a Democratic strategist in Boston. “He’s always the outsider. He’s always willing to take on people. He’s always willing to take on the establishment.”

He also is cementing his credentials among independent voters, a group that he’ll want to woo down the line should he decide to advance in politics and a bloc he believes that Democrats need to more aggressively court in general.

The more immediate side-effect of taking on Pelosi has been another positive bump for Moulton’s profile. This isn’t insignificant. Being relevant as a back-bench congressman in the minority party is difficult. And not incidentally, he has been mentioned as potential presidential timber in the news media.

Moulton relishes this spotlight, especially when there’s a tough edge to it. “I’m brutally honest with people,’’ he said.

* * *

Brutal honesty has gotten Moulton into some trouble in the past, especially in one of the most heralded chapters in his life: his four tours of Iraq.

Advertisement

“He did not hesitate to forthrightly offer assessments to others,” said retired General David Petraeus, to whom Moulton directly reported in Iraq in 2005 as a lieutenant and again during the surge from 2007 to 2008 when he was a captain.

It was an unusual arrangement, having a relatively low-ranking Marine reporting directly to a top military commander, and Petraeus said he gave Moulton wide latitude.

When traveling through the country, Petraeus said, he’d often order his helicopter to touch down wherever Moulton happened to be operating. The young Marine would toss him a rucksack of paperwork filled with requests for various projects. Petraeus wouldn’t even look at the folders, and instead approved all of the materials without opening the bag.

“He undoubtedly ruffled feathers,” Petraeus said, noting that even his top aides wondered why this young upstart was granted so much freedom by the boss. “And I ruffled feathers. I wasn’t sent out there to lose gracefully. I was — all of us were — determined to turn around a failing effort.”

Petraeus said he handpicked Moulton to be part of his team, a group that was trying to rebuild Iraqi military and civilian institutions, precisely because of Moulton’s willingness to take risks and battle bureaucracies.

“Seth wasn’t the easiest subordinate, which was one reason I was eager to get him on my team,” Petraeus said.

Petraeus said he sees some parallels between what Moulton is doing in his political career now, by taking on his own party’s leadership, and what their team was trying to achieve in Iraq. But he also offered a warning of sorts.

Moulton acknowledged that he found himself on the wrong side of important people while serving in the military.

“You probably can’t find a living Marine who, I don’t know if you can print this, who has had his ass chewed by more general officers than this guy,” Moulton said over plates of tacos in Lynn.

He recalled one episode in Basra, where he insisted on working closely with soldiers from the Iraqi army at a time when other military leaders wanted Americans to minimize contacts with locals for safety reasons.

A three-star general learned about his activities, hauled him in to his office and, in Moulton’s telling, said: “Moulton, you’re a god-damned cowboy.”

Moulton said he took it as a compliment.

* * *

Cowboys don’t always make the best legislators, particularly in the House of Representatives, where lawmakers traditionally must build strong coalitions to push even minor and seemingly noncontroversial pieces of legislation through the intentionally sticky process.

But his actions are consistent with a tradition of Massachusetts lawmakers displaying the kind of ambition that attracts national attention.

Massachusetts has a “very long history of strong political leadership,” said US Representative Joe Kennedy III, another rising star in the delegation.

Strong leaders rock the boat, Kennedy said.

“There’s an expectation that your members in the House are going to be leading the debate and your senators are going to be national figures,” Kennedy said.

Moulton said that he does not associate himself closely with any particular wing of the Democratic Party.

“Don’t try to pin me down,” joked Moulton, who initially considered challenging Tierney as an independent in 2012 because he would have gotten in the race too late to win the Democratic nomination.

He believes the party should be focused more on support for small businesses. And he has echoed some of the Republican rhetoric about onerous regulations.

But he hews closely to the party line when bills come to the House floor. He’s voted with Pelosi 94 percent of the time, according to a tally by CQ Roll Call.

* * *

Moulton’s criticism of Pelosi is being tracked closely in his district, where he’s receiving a measure of support for those comments.

“Thanks for what you’re doing with leadership,” said Sean Cahill, a 54-year old Beverly man who met Moulton after the Salem gay pride parade.

Earlier that morning, during a town hall meeting Moulton held in Beverly, the first question was about Pelosi.

“I support you 100 percent in the change in leadership,” said the questioner, who identified himself as Terry from Boston. “I think you were very courageous.”

Moulton explained his thinking to the audience. “The best argument is that we’re losing,” he said, earning him a round of applause. “That’s the reality. You can’t keep double-downing on losing.”

* * *

Moulton has forged some deep ties across the aisle, including with Republican intellectuals who respect him though they do not always agree with him. A prominent member of this group is Bill Kristol, the founder of the conservative Weekly Standard magazine.

He sees a place for Moulton in finding common ground with House Republicans on smaller bore issues that are important to his district, including combating opioids and job retraining.

“You could see some legislation with interesting sponsors, not from the leadership, not from the top, but bills that come bubbling up in 2018,” Kristol predicted. “That could be something where Seth would be an obvious person.”

And on a personal level at least, Moulton does have some relationship with the 47-year-old leader of the House Republicans: Paul Ryan.

He got special permission from Ryan to propose to his girlfriend, Liz Boardman, on the Speaker’s Balcony, a gorgeous terrace in the US Capitol with a commanding view of the National Mall. And Ryan even shooed away others so Moulton would have the patio to himself.

But it wasn’t an entirely private moment; the speaker watched Moulton pop the question from his office window. Afterward, Ryan walked outside and was the first person to embrace the newly engaged couple.