WASHINGTON — President Trump on Wednesday loosened some rules for commercial drones, including for package deliveries, by allowing broader testing by companies like Amazon and Wing, a part of Alphabet.

Mr. Trump signed an executive memorandum to allow more companies to test their flying machines at night, above people, at far greater distances and with packages — activities limited by federal restrictions.

The Transportation Department will work with states, towns and tribal communities to create pilot programs, the White House said. For example, a drone maker like DJI could apply with a town to test drone deliveries from 2 a.m. to 4 a.m.

The pilot programs are expected to be put in place within one year.

The announcement is a victory for tech companies that have bet that drone deliveries will be a part of retail in the future, as well as entertainment companies that want to use the machines for filming. Amazon, Google, DJI, Intel and Hollywood lobbied the Obama administration to ease rules on commercial unmanned aerial vehicles, or drones. Amazon even proposed a future highway system in the sky, in which lower altitudes would be reserved for lighter weight drones that could deliver packages.