It was the late Steve Jobs' worst nightmare.
Samsung Electronics uses Google's Android software to create smartphones and tablets that closely resemble the iPhone and the iPad. Samsung starts gaining market share, hurting Apple's margins and stock price and threatening its reign as the king of cool in consumer electronics.
Jobs, of course, had an answer to all this: a "thermo-nuclear" legal war that would keep clones off the market. Yet nearly two years after Apple first filed a patent-infringement lawsuit against Samsung, and six months after it won a huge legal victory over its South Korean rival, Apple's chances of blocking the sale of Samsung products are growing dimmer by the day.
Indeed, a series of recent court rulings suggests that the smartphone patent wars are now grinding toward a stalemate, with Apple unable to show that its sales have been seriously damaged when rivals, notably Samsung, imitated its products.
That, in turn, may usher in a new phase in the complex relationship between the two dominant companies in the growing mobile computing business.
Tim Cook, Jobs' successor as Apple chief executive, was opposed to suing Samsung in the first place, said sources, largely because of that company's critical role as a supplier of components for the iPhone and the iPad.
Apple bought some $8 billion worth of parts from Samsung last year, analysts estimate.
Samsung, meanwhile, has benefited immensely from the market insight it gained from the Apple relationship and from producing smartphones and tablets that closely resemble Apple's.
The two companies' strengths and weaknesses are in many ways complementary.
As their legal war winds down, it is increasingly clear that Apple and Samsung have plenty of common interests as they work to beat back other potential challengers, such as BlackBerry or Microsoft.
The partnership dates to 2005, when Apple was looking for a stable supplier of flash memory. Apple had decided to jettison the hard disc drive in creating the iPod shuffle, iPod nano and iPhone, and it needed huge volumes of flash memory chips to provide storage. The memory market in 2005 was extremely unstable, and Apple wanted to lock in a supplier that was rock-solid. Samsung held about 50% of the NAND flash memory market at that time. The success of that deal led to Samsung supplying the crucial application processors for the iPhone and iPad.