Amazon.com Inc has beaten rivals Apple Inc and Google Inc by introducing an online music locker service that lets customers play songs they already own on many smartphones and computers.

Amazon's Cloud Drive, announced on Tuesday, will let customers store music files on the company's Web servers instead of their own hard drives and play them over an Internet connection directly from Web browsers and on phones running Google's Android software.

The service may push Amazon into legal gray area. In 2007, EMI sued MP3tunes, which offered a similar service. Consumers are allowed to store music files on their own computers, but it is unclear whether they have that right when they use remote storage services offered by cloud computing.

Cloud Drive is a coup for Amazon, which beat Google and Apple into the new market. The two rivals were expected to launch their services at the end of last year.

The service is part of Amazon's plan to be a bigger player in the digital content business and reduce its reliance on the sales of CDs and books.

They don't have leadership in digital formats, said BGC Partners analyst Colin Gillis. The next big race is locker services -- that's what we want.

Gillis said he expected Google to introduce a remote music storage service in May and for Apple to follow suit in June.

Although Amazon's service lets users listen to music from most computers or phones regardless of where they bought the song, it will not work on Apple's iPhones or have an app on that company's devices.

Amazon said customers would initially get 5 gigabytes of free storage.

A customer can get an upgrade to 20 gigabytes of free storage with the purchase of any MP3 format album from Amazon.

New music purchases from Amazon saved directly to the cloud service will not count against any storage quota.

Users can save music files in MP3 as well as the AAC format, which is the standard for Apple's iTunes service.

Amazon is also offering Cloud Player, which will allow music fans to listen to, download and make playlists on any Web browser as well as any application using Google's Android operating system.

Shares of Amazon were up 2.3 percent at $173.31 in morning trading, while Google rose 0.3 percent to $576.87. Apple fell 0.7 percent to $348.17.

(Reporting by Phil Wahba in New York; additional reporting by Sakthi Prasad in Bangalore, editing by Gerald E. McCormick and Lisa Von Ahn)