The SBU security service said the raid was part of a new criminal inquiry
Ukrainian national security service agents have raided the head office of the state energy firm Naftogaz in Kiev.
The raid by armed agents was linked to an investigation into the diversion of 6.3bn cubic metres of gas worth $880m (£620m), whose ownership is in dispute.
Earlier, a Naftogaz spokesman said armed men were on the building's third floor, near a deputy director's office.
Naftogaz was at the heart of a dispute with Russia in January that led to gas shortages for millions across Europe.
Russia's state gas firm, Gazprom, suspended gas supplies to Ukraine for two weeks until Ukraine's government and Naftogaz agreed prices at which they would buy Russian gas, and ship it to Europe.
Gazprom has threatened to switch off the gas again if Naftogaz does not settle $400m of debts by the end of this week.
Security Service of Ukraine (SBU) spokeswoman Marina Ostapenko confirmed that SBU agents had raided Naftogaz's headquarters as part of a "standard" criminal investigation launched earlier this week.
She insisted the company had been informed in advance that investigators would be taking documents, and that the action was "all within the framework of the law".
The SBU said their investigators had been physically attacked while trying to enter the building and that the armed agents were for their own protection.
Naftogaz spokesman Valentyn Zemlyansky had initially told reporters that he feared a group of armed men might be attempting to seize control of the company.
He said they had pushed aside security personnel without showing any identification and had taken up positions outside the office of deputy director Igor Didenko.
At the building, parliamentarians representing Ukrainian Prime Minister Yulia Tymoshenko insisted the raid was illegal.
"I would like to address employees of the Security Service... You have the right to disobey the criminal order, you must not become a tool of criminals," Deputy Prime Minister Oleksandr Turchynov said.
The SBU said it wanted to examine documents and question Naftogaz employees about the appropriation of 6.3bn cubic metres of natural gas, whose ownership is in dispute following the deal struck between Moscow and Kiev on 18 January.
MPs representing the Ukrainian prime minister insisted the raid was illegal
It said the gas belonged to an intermediary company, RosUkrEnergo, which was until recently at the centre of the gas trade between the two countries. Naftogaz says the gas belongs to the Ukrainian state.
The BBC's Gabriel Gatehouse in Kiev says January's agreement was supposed to eliminate RosUkrEnergo, which is part-owned by Gazprom and partly by two Ukrainian businessmen.
After Wednesday's raid, the head of Naftogaz's legal department said the SBU agents had expected "to come away with the original documents signed between Naftogaz and Gazprom in January".
"If we don't have these contracts, then Naftogaz cannot bring the gas through customs or the transit of gas. It cannot carry out its obligations under these contracts," Serhiy Davydenko told the Reuters news agency.
Negotiations on the contracts were led by Prime Minister Tymoshenko and her Russian counterpart, Vladimir Putin. The deal was criticised at the time by her ally-turned-rival, President Viktor Yushchenko.
The SBU is overseen by the president, while Naftogaz answers to the prime minister.
Our correspondent says the incident could jeopardise January's deal.