Two Romanian nationals were sentenced to prison terms Wednesday for their roles in a multimillion-dollar scheme to hack into US merchants' computer networks to steal credit card data, officials said.

The Justice Department said Adrian-Tiberiu Oprea, 29, of Constanta, Romania, was sentenced to 15 years in prison, and Iulian Dolan, 28, of Craiova, Romania, to seven years.

They were among four people charged in 2011 in the scheme to remotely hack into and steal payment card data from hundreds of US merchants' computers, including those of the Subway restaurant franchise.

The group stole credit card data belonging to more than 100,000 US cardholders, in a scheme costing $17.5 million in unauthorized charges and remediation expenses, the Justice Department said.

The scheme identified vulnerable systems and installed keystroke loggers to gain access between 2009 and 2011, according to court documents.

Oprea and Dolan retrieved the card data and then electronically transferred it to various locations. Subsequently, they used the stolen payment card data to make unauthorized charges on, or transfers of funds from, the accounts.

The group hacked into several hundred US merchants' computer systems, including 250 Subway restaurant franchises, officials said.

Oprea, who was extradited to the United States from Romania, pleaded guilty in May to one count of conspiracy to commit and related charges.

Dolan pleaded guilty last September to similar charges.