I suggested the link to make you understand how strong armed civilians were.
Feudal era, like Edo period, samurais are nobility as you said.
But in War era, many civilians armed and fought to survive.
After they survived, they became samurais and Ninjas.
Toyotomi Hideyoshi, who unified Japan was peasant.
Toyotomi Hideyoshi - Wikipedia, the free encyclopedia
Feudal lords were afraid of their civilians over their enemies.
Toyotomi Hideyoshi was strongly afraid of civilians and taked arms away from civilians.
Sword hunt - Wikipedia, the free encyclopedia
After that, feudal era, samurai class became nobility.