This post has been updated.

House ethics rules say an aide can’t run to succeed his or her boss and stay on the congressional payroll, but a staffer for Rep. Roscoe Bartlett (R-Md.) did so for the past four months.

The aide in question, Alex Mooney, moved to fix what Bartlett’s office called a “clerical error” Thursday after being contacted about the matter by The Washington Post.

Mooney, who also serves as chairman of the Maryland Republican Party, has been on Bartlett’s staff since June, according to House payroll records, which list Mooney as a ”part-time employee” who made $2,000 that month. Mooney told in July that he was working for Bartlett a couple of days a week as “community outreach director.”

Mooney, who also worked as an aide to Bartlett earlier in his career, considered running for Bartlett’s seat this year when some Republicans thought the veteran lawmaker would retire. Instead, he declared in January that he would not run and would support Bartlett for reelection. Bartlett fended off seven Republican challengers in the April primary but now faces a tough general election race against financier John Delaney (D) in a district that was altered in the redistricting process to favor Democrats.

Mooney chose not to run this year, but in March he filed a “Statement of Candidacy” for the 2014 race with the Federal Election Commission, a step that allowed him to continue accepting campaign checks even though he was out of the 2012 race.

The problem with this arrangement is that the House Ethics Manual says that if a congressional employee is seeking to succeed his or her boss in office, “the staff member must terminate his or her employment in the congressional office upon becoming a candidate.”

An aide can remain employed so long as he or she is only “testing the waters” for a congressional race, the ethics manual says. But the FEC’s guide for candidates makes clear that once a person files a Statement of Candidacy — as Mooney did three months before joining Bartlett’s staff — “he or she is no longer considered to be testing the waters.”

On Thursday, one day after The Washington Post contacted Bartlett’s office to ask about the issue, Mooney sent a letter to the FEC announcing that, “effective immediately, I am no longer associated with Mooney for Congress. ... As such I am no longer a candidate for office in Maryland’s 6th congressional district.”

Referring to the letter, Bartlett spokeswoman Lisa Wright said Thursday: “Paperwork clarifying the clerical error of Alex Mooney’s status as a non-candidate by the FEC has been filed.”

Mooney himself said much the same Thursday night.

“This is a misunderstanding,” he said. “I am not a candidate for any office at this time.”

The ethics rule exists because of the potential that aides could mix campaign work with official business as they deal with constituents of the congressional office they hope to fill, explained Rob Walker, a former chief counsel and staff director of both the House and Senate ethics panels.

“When it is a staffer [running for office], then the Ethics Committee has deemed it appropriate to address the potential for a conflict of interest by making an individual choose,” Walker said. “In this circumstance, it appears that the individual has chosen.”

It’s not clear whether Bartlett or Mooney will face official scrutiny over the issue, particularly given Mooney’s latest FEC filing. The House Ethics Committee traditionally does not initiate new probes of lawmakers this close to an election, though the Office of Congressional Ethics, a separate body tasked with vetting potential complaints and forwarding them to the Ethics Committee, could choose to initiate an investigation.

This post has been updated since it was first published.