Judge Humberto Otazu ordered Pena, who has been charged with breach of trust and administration for personal gain, saying detention was necessary to ensure he remained in the country while the case proceeded.
The detention, a day after Pena's removal from office, deepens a political and financial crisis that has prompted protests in Asuncion, swept up senior officials and led regulators to try to contain risks to the wider financial system.
Pena's lawyer, Ricardo Preda, told journalists his client was pleading not guilty to the charges.
"We will submit to the investigation and I am sure that when this investigation is over the result will be the dismissal," Preda said.
Prosecutors also charged former central bank chief Carlos Carvallo with breach of trust, producing false public documents and administration for personal gain, and sought his pre-trial detention, a request on which the court had yet to rule.
Carvallo did not respond to a request for comment.
Prosecutors allege Pena used his position as president to influence decisions by government agencies and state-owned entities to keep large amounts of public money deposited at Ueno, despite maintaining financial ties to the lender.
They say that relationship created a conflict of interest as Pena encouraged, facilitated or influenced decisions benefiting the bank.
Pena, who was a shareholder in Ueno's holding company until March 2025, has denied wrongdoing and said the bank's problems were a regulatory matter.
Pena had arrived at the Attorney General's Office earlier on Saturday to appear before prosecutors following his dramatic removal from power on Friday. His ouster brought Vice President Pedro Alliana to power, with the longtime ruling Colorado Party politician sworn in on Friday to complete Pena's term through August 2028.
The two charges against Pena could carry a sentence of up to 10 years in prison each, prosecutor Nancy Salomon said.
Carvallo resigned as central bank chief earlier this week as the crisis surrounding Ueno escalated.
The central bank said the equivalent of $US160 million had been paid out to nearly 1.2 million savers, under the state deposit guarantee scheme.