Image copyright AP

US presidential candidate Hillary Clinton has been questioned by the FBI over her use of emails while she was secretary of state, her campaign says.

A spokesperson said it was a voluntary interview.

The FBI is investigating Mrs Clinton and her aides over whether they mishandled classified information on a private email server she used while serving as secretary of state.

Mrs Clinton denies handling classified information in her private emails.

She said she set up the email address for reasons of convenience, because it was easier to do everything from her Blackberry than to have several phones or tablets.

However, a state department inquiry accused her and other former US secretaries of state of poorly managing email security.

The justice department is now seeking to establish whether this constitutes a criminal offence.

Analysis: Laura Bicker, BBC News, Washington

Let's face it - this is not really how you want to start a presidential campaign.

Hillary Clinton is trying to pitch herself as a sensible, qualified, experienced candidate who's facing an outlandish controversial opponent in Donald Trump.

Being questioned by the FBI for three and a half hours is not going to help her case.

It gives her Republican opponents ammunition to describe her as untrustworthy. Mr Trump has already nicknamed her "crooked Hillary" and uses it with glee at every campaign stump speech.

The timing of this long-awaited interview is also interesting. This is a holiday weekend filled with Independence Day barbeques and parades. The Clinton campaign will hope that voters are more interested in where to watch the fireworks than the rolling network news coverage.

In just a few weeks Hillary Clinton will stand on the Democratic convention stage and be formally announced as the party nominee. During that same time, the FBI will decide whether or not to bring formal charges. Legal experts say it is unlikely. In that case she may have time to put this controversy behind her personally.

But there's no doubt that, politically, her opponents are never going to let her forget it.

On Friday, the US Attorney General Loretta Lynch said she would accept the findings of the FBI and prosecutors, when deciding whether to charge Mrs Clinton.

The day before, it was revealed that Ms Lynch had met the former president, Mrs Clinton's husband Bill, in what she described as a "social" meeting but which she admitted would "cast a shadow" over the way her role in the case would be perceived.

Mrs Clinton is the presumptive nominee for the Democratic Party and party members are expected to confirm the nomination at a convention at the end of July.

Anthony Zurcher on the Clinton email controversy:

Image copyright Getty Images Image caption Mrs Clinton said some of the personal emails involved planning for her daughter's wedding

Shortly before being sworn in as secretary of state in 2009, Hillary Clinton set up an email server at her home. She relied on it for all her electronic correspondence during her four years in office.

Why is this controversial?

It was probably not against the law.

But sceptics say she did it to have total control over her correspondence, becoming the sole arbiter of what should and shouldn't be provided to the government, made public via freedom of information requests or turned over to interested parties, such as the congressional committee investigating an attack on the US consulate in Benghazi.

Critics have also expressed concern that the system made her emails more vulnerable to being hacked.

Have other politicians done this?

Yes. Mrs Clinton is far from alone. Others have sometimes relied on personal email for official business.

But unlike them, Mrs Clinton used her personal email address exclusively.

Read more: Emailgate diced and sliced