Apple received fewer government demands for data during the first-half of this year, but it saw a spike in secret national security orders.

New figures revealed in the company's first biannual transparency report shows that Apple received 30,814 demands to access 233,052 devices in the first-half of the year, down 6 percent compared to last year.

Apple also received 3,020 requests for data on 43,836 accounts, such as iCloud content, stored photos, email, contacts, and device backups. Those account requests are down by 15 percent compared to last year. Apple noted that the high number of accounts related to unauthorized access. In March, hackers demanded a ransom or it would remotely wipe "millions" of iCloud accounts. The hackers never followed through with their threat.

But the number of national security orders, including secret rulings from the Foreign Intelligence Surveillance Court, spiked during the period.

The company received between 13,250 and 13,499 national security orders, affecting between 9,000 and 9,249 accounts.

That's a threefold increase compared to the year earlier, which saw up to 2,999 orders for the period.

It's the largest number of national security orders that Apple has ever reported in five years of publishing transparency reports.

Apple and other companies remain subject to heavy reporting restrictions on national security orders. Since the introduction of the Freedom Act in 2015, the Justice Department was forced to relax the rules on how companies report secret and classified orders, allowing tech companies to report the number of secret demands in narrower bands.

In its last report, Apple revealed it had become the latest tech giant to have a national security letter declassified. As with all national security letters, the order to turn over customer data includes a gag order, preventing the company or anyone else from disclosing the contents -- even to the customer in question. The company didn't post the details of the letter.

Apple did not reveal any declassified orders in this report.

The company also confirmed it has "not received any orders" for bulk account data, a legal provision typically reserved for phone companies.

The company also said it received 1,108 requests to preserve account data, typically in order to allow an authority to obtain the proper legal process for the data. Almost all the preservation requests came from the US government.

For the first time, Apple revealed that it provided data in 44 cases in civil non-governmental cases.