Rubio, who is on his first oversees tour as the U.S. top diplomat, is seeking support from countries in the region for the Trump administration's attempts to deport large numbers of migrants.
He met with El Salvador's President Nayib Bukele and senior officials at Bukele's residence on Lake Coatepeque outside the capital for almost three hours, where they agreed to go beyond El Salvador's acceptance of its own deported citizens.
"Any ... illegal immigrant in the United States who’s a dangerous criminal - MS-13, Tren de Aragua, whatever it may be - he has offered his jails, so we can send them and he will put them in his jails," Rubio said, referring to members of criminal gangs.
As well as smoothing the way for the U.S. to send migrants back to their own countries, Rubio is trying to secure “third country” agreements, in which nations accept citizens of other countries that will not accept deportees.
Cuba and Venezuela, for instance, have frosty relations with the U.S. and have in the past limited the number of deportees they will accept, although the Trump says Venezuela's President Nicolas Maduro has agreed to accept back his country's citizens.
Bukele also offered to house dangerous criminals who are U.S. citizens or legal residents, Rubio said, although it was unclear whether the U.S. would take up that offer. More details of the agreement would be forthcoming, he added.
U.S. citizens cannot legally be deported from the United States.
The U.S. State Department's website notes that prison conditions in El Salvador are "harsh and dangerous."
"Overcrowding constitutes a serious threat to prisoners’ health and lives," the website says. "In many facilities, provisions for sanitation, potable water, ventilation, temperature control, and lighting are inadequate or nonexistent."
Bukele said in a post on X that he had offered the U.S. "the opportunity to outsource part of its prison system".
"We are willing to take in only convicted criminals (including convicted U.S. citizens) into our mega-prison... in exchange for a fee," he wrote shortly after Rubio's announcement, referring to El Salvador's so-called terrorism confinement center.
"The fee would be relatively low for the U.S. but significant for us, making our entire prison system sustainable."
Bukele is seen by the Trump administration as a key ally in its migration efforts in the region. The Salvadoran president has launched an unflinching security crackdown in his country, arresting more than 80,000 people, and bringing the number of homicides down sharply. His policies are credited by Washington with reducing the number of Salvadorans seeking to enter the U.S. illegally.
Since taking office on Jan. 20, President Donald Trump has stepped up the number of migrants the U.S. deports to Latin America, including using military planes for repatriation flights.
The Trump administration on Monday removed protection against deportation from hundreds of thousands of Venezuelans in the U.S.
Trump last week said he was expanding a detention facility at the U.S. naval base in Guantanamo Bay, Cuba, to hold 30,000 people.