An anti-abortion computer hacker who stole the personal details of 10,000 women from Britain's largest pregnancy advisory clinic has been sentenced to almost three years in prison.

James Jeffery, 27, was a member of the hacking collective Anonymous and had intended to publish the names, email addresses and telephone numbers of thousands of women, which he had taken from the British Pregnancy Advisory Service (BPAS) website.

Jeffery, who had previous convictions for theft, cannabis cultivation and assault, had pleaded guilty to two offences under the Computer Misuse Act at Westminster magistrates court.

During sentencing at Southwark crown court on Friday, it was revealed that Jeffery was a member of Anonymous who had been in contact with their leader, Hector Xavier Monsegur, also known as Sabu, for more than a year. Last month Monsegur was revealed to be working for the FBI as an undercover informant. It is not known whether Monsegur knew of Jeffery's plans in advance.

Copying Anonymous's style, Jeffery boasted of his feat on Twitter soon after his crime. However, the former software engineer, described in court as an "able" hacker and "whiz-kid", was quickly tracked down by police to his home address in Wednesbury in the West Midlands after he failed to hide his computer's IP details. Police arrested him in the early hours of the morning of 9 March.

The court was told that Jeffery had targeted the BPAS because he disagreed with the decisions of two women he knew to terminate their pregnancies.

After hacking into BPAS systems Jeffery also "defaced" its website's homepage with the logo of the hacking group Anonymous and plastered it with an anti-abortion screed.

"An unborn child does not have an opinion, a choice or any rights," Jeffery wrote. "Who gave you the right to murder an unborn child and profit from that murder?

"The product abortion is skilfully marketed and sold to the woman at a crisis time in their life. She buys the product, finds it defective and wants to return it for a refund but it is too late."

He signed off the statement using the alias of the infamous Colombian drugs baron Pablo Escobar, the court was told.

During his interview with police, Jeffery also admitted to detectives that he had identified "vulnerabilities" on a string of websites of major international organisations including the FBI, CIA, West Midlands police, the Houses of Parliament, the US navy, Arizona police and Spanish police.

Sentencing Jeffery to 32 months, Judge Michael Gledhill QC said: "Those who find abortion repugnant do not use it as an excuse to justify deliberately committing offences. Your skills are so good that you decided to hack into their [BPAS's] website and you succeeded.

"You stole the records of approximately 10,000 women. Many of them were vulnerable women, vulnerable simply because they had had a termination or because of their youth or because their family did not know about their situation.

"You were proud about what you had done - you boasted about it on Twitter.

"In my view, it is significant that the online name you used on Twitter was that of notorious criminal Pablo Escobar."

In mitigation, lawyer Shaun Wallace, told the court that Jeffery had entered the website to test its vulnerability, adding: "The more curious he became, the less responsible he became."

He said that Jeffery was not a staunch anti-abortionist and that the statement pasted by him on the BPAS website was "cut and pasted from Google".

Speaking about Jeffery's threat to publish the database of personal details, the judge said: "You only have to think for a few seconds of the terrible consequences had that threat been carried out."

"The sentence that I impose is both to punish you for what you have done and to send out a clear message of deterrence to anyone tempted to commit similar hacking offences."

• This article was amended on 16 April 2012. The original said Wallace was not a staunch anti-abortionist. This remark was made by Wallace about Jeffery.