CARACAS, Venezuela — Masked government agents stormed the homes of two former top officials of Venezuela’s state oil company and arrested them on Thursday, a move that the prosecutor heralded as a blow against corruption but that others saw as a political purge to strengthen the country’s president.

The accused men, Nelson Martínez and Eulogio del Pino, are the highest-level officials detained in a string of arrests that have shaken the country’s troubled oil giant, Petróleos de Venezuela, and its United States refiner, Citgo. More than 50 people so far have been detained in a widening net of charges from corruption to sabotage.

Mr. Martínez, a former oil minister who led the oil company until this week, was detained early Thursday and charged with seeking debt refinancing contracts without getting government approval, said Tarek William Saab, the Venezuelan attorney general.

Mr. Del Pino, Mr. Martínez’s predecessor, was arrested on a list of charges that included falsifying production figures and sabotage that resulted in millions of dollars in lost revenues, Mr. Saab said.