Nils J. Nilsson, a computer scientist who helped develop the first general-purpose robot and was a co-inventor of algorithms that made it possible for the machine to move about efficiently and perform simple tasks, died on Sunday at his home in Medford, Ore. He was 86.

His death was confirmed by his wife, Grace Abbott.

Dr. Nilsson was a member of a small group of computer scientists and electrical engineers at the Stanford Research Institute (now known as SRI International) who pioneered technologies that have proliferated in modern life, whether in navigation software used in more than a billion smartphones or in such speech-control systems as Siri.

The researchers had been recruited by Charles Rosen, a physicist at the institute, who had raised Pentagon funding in 1966 to design a robot that would be used as a platform for doing research in artificial intelligence.

Although the project was intended to create a general-purpose mobile “automaton” and be a test bed for A.I. programs, Mr. Rosen had secured the funding by selling the idea to the Pentagon that the machine would be a mobile sentry for a military base.