Washington (CNN) -- Former Democratic vice presidential nominee and two-time presidential candidate John Edwards pleaded not guilty Friday to conspiracy and campaign law violations, acknowledging that he had "done wrong," but denying that he broke the law.
His plea came hours after a federal grand jury indicted him on six counts, including conspiracy, issuing false statements and violating campaign contribution laws.
"There's no question that I've done wrong," Edwards told reporters outside federal court in Winston-Salem, North Carolina. "But I did not break the law and I never, ever thought I was breaking the law."
He was released on his own recognizance, but was ordered to surrender his passport and remain within the lower 48 states.
If convicted on all counts, Edwards would face up to 30 years in prison and a maximum fine of $1.5 million.
Edwards' attorney, Greg Craig, insisted the former North Carolina senator "will mount a vigorous defense."
A grand jury has been investigating whether money given to support Edwards' mistress, Rielle Hunter, by benefactors of Edwards should have been considered campaign donations, a contention Edwards' team has disputed.
Prosecutors allege that Edwards improperly accepted over $900,000 as part of an effort to conceal facts he believed would damage his White House bid.
Plea discussions had been ongoing between Edwards' defense lawyers and federal prosecutors, but no agreement was reached. Edwards had not wanted to plead guilty to a felony because he could lose his law license, a source familiar with the inquiry previously told CNN.
"Democracy demands that our election system be protected, and without vigorously enforced campaign finance laws, the people of this country lose their voice," U.S. Attorney George E.B. Holding said in a written statement. "The U.S. Attorney's Office and the Department of Justice are committed to the prosecution of individuals who abuse the very system of which they seek to become a part."
"Public servants are held to the same laws as everyone else in this country. The position sought does not exempt anyone, even those running for president of the United States," said North Carolina FBI lead agent Chris Briese.
The case involves financial aid given to Hunter. During their affair, Hunter became pregnant with Edwards' baby, though at first he denied he was the father.
While prosecutors believe the monetary help given to Hunter by two of Edwards' political backers should have been considered campaign donations, Edwards' attorneys disagree.
"This is an unprecedented prosecution," Craig said. "No one would have known or could be expected to know that these payments would be treated as campaign contributions, and there is no way Senator Edwards knew that fact either."
Craig said the government's theory of the case "is wrong on the facts and wrong on the law."
The government is believed to be building its case that Edwards violated campaign finance law based on an 11-year-old advisory opinion issued by the Federal Election Commission, which asserted that a gift to a candidate for federal office would be considered a campaign contribution, a source with knowledge of the inquiry told CNN this week.
The decision, dated June 14, 2000, is known as "Harvey." It's named after a man named Phillip Harvey who sought guidance from the FEC because he wanted to give money to someone who was preparing to run for federal office, but didn't want the money to be used for campaign purposes.
The opinion is important because Hunter received more than $1 million from two contributors, 100-year-old philanthropist Rachel "Bunny" Mellon of Virginia and attorney Fred Baron, who has since died.
Edwards was ordered Friday to stay away from Mellon for the duration of his legal proceedings.
Edwards' attorneys have said that the payments were not and should not be considered political contributions. If they weren't political contributions, what were they? The most widely reported theory -- which the Edwards team has publicly neither confirmed nor denied -- is that the money was given to keep Edwards' wife, Elizabeth, from finding out about his mistress and child.
Elizabeth Edwards died of cancer last December.
The source with knowledge of the inner workings of the case and other legal observers have noted that the Harvey advisory opinion is shaky ground to base a federal prosecution on because it is not a black-letter federal statute, and apparently has not been cited in any important case law, or as legal authority behind any important court decisions.
Some experts have said the Justice Department will have a strong case in court if it can prove Edwards knew about the funds and what they were being used for -- a contention he has denied.
CNN's Carol Cratty, Joe Johns, John King, and Alan Silverleib contributed to this report.