A British man has been charged in the US with hacking into thousands of computer systems, including those of the US army and Nasa, in an alleged attempt to steal confidential data.

Lauri Love, 28, is accused of causing millions of pounds of damage to the US government with a year-long hacking campaign waged from his home in Stradishall, a village in Suffolk.

Love was arrested on Friday by the National Crime Agency, dubbed "Britain's FBI", after an international investigation led by the US army's criminal investigation command.

His arrest was announced on Monday after US prosecutors filed an indictment in a federal court in Newark, New Jersey.

The New Jersey district attorney, Paul Fishman, said: "According to the indictment, Lauri Love and conspirators hacked into thousands of networks, including many belonging to the United States military and other government agencies.

"As part of their alleged scheme, they stole military data and personal identifying information belonging to servicemen and women. Such conduct endangers the security of our country and is an affront to those who serve."

Love is charged with one count of hacking into a US department or agency computer and one count of conspiring to do the same.

The indictment, which was released by the US department of justice on Monday, describes Love as a "sophisticated and prolific computer hacker who specialised in gaining access to the computer networks of large organisations, including government agencies, collecting confidential data including personally identifiable information from within the compromised networks, and exfiltrating the data out of the compromised networks".

He is accused of targeting the computer networks of the US army, US missile defence agency, environmental protection agency and Nasa, with attacks between October 2012 and this month. Love, who has not been charged in the UK, has been released on bail until February.

Love is alleged to have used the online monikers "nsh", "route", and "peace" to plot attacks from his home with three unnamed conspirators in Australia and Sweden.

It is alleged that Love successfully stole the personal details of more than 5,000 servicemen and servicewomen and former government employees, including "numerous" Nasa workers, in 10 separate online assaults.

He faces up to 10 years in a US prison if he is found guilty, according to prosecutors, who said that he would also be liable to pay a fine of $250,000 (£154,000) or twice the gross loss from each of the two alleged offences.

The 28-year-old is said to have used hidden online chats to plan the attacks, which were allegedly carried out after spotting vulnerabilities in US military websites. The group allegedly placed hidden "shells" or "back doors" within the hacked networks, which allowed them to return at a later date and steal confidential data.

He is alleged to have told one co-conspirator during one of these chats: "We might be able to get at real confidential shit".

In other chats published in the indictment, Love is alleged to have said: "You have no idea how much we can fuck with the US government if we wanted to," and, after describing the data as "really sensitive", adding: "It's basically every piece of information you'd need to do full identity theft on any employee or contractor for the [government agency]."

A second alleged hacker is accused of boasting about stealing "400k emails" from an army database. The attack on Nasa is alleged to have happened on 10 and 11 July this year. According to the indictment, Love told other alleged hackers "we owning [hacking] lots of nasa sites" and: "I think we can do some hilarious stuff with it."

Andy Archibald, a spokesman for the National Crime Agency, said: "This arrest is the culmination of close joint working by the NCA, Police Scotland and our international partners.

"Cybercriminals should be aware that no matter where in the world you commit cybercrime, even from remote places, you can and will be identified and held accountable for your actions.

"The NCA has well developed law enforcement alliances globally and we will pursue and deal robustly with cyber.criminals."