The microwave oven was invented in 1945 by Percy Spencer, a self-taught engineer working on radar technology for Raytheon, after he noticed a chocolate bar in his pocket melted near a magnetron. 

Here's a more detailed account:

Accidental Discovery:

While working with radar technology and a magnetron (a device that produces microwaves), Spencer noticed a chocolate bar in his pocket had melted. 

Further Experimentation:

Curious, he experimented with popcorn kernels and eggs near the magnetron, observing that the popcorn popped and the eggs cooked. 

Development of the Microwave Oven:

Spencer and his team developed the first microwave oven, which was initially large and bulky, and intended for commercial use. 

Early Commercial Use:

The first commercial microwave oven, called the "Radarange", was introduced in 1946 and was used in restaurants, canteens, and ship galleys. 

Home Use:

Over time, microwave technology was refined, leading to smaller, more affordable models suitable for home kitchens. 

Raytheon Patent:

Raytheon filed a patent for a microwave cooking process on October 8, 1945. 

First Countertop Model:

The first countertop home model went on sale in the 1950s. 

Widespread Adoption:

By 1997, nearly 90% of U.S. households owned a microwave oven.