When was the musket miniaturised into pistol form (i.e when was the pistol invented)?

by THREE_EDGY_FIVE_ME

And was the pistol a popular weapon from the beginning?

Bodark43

There were hand cannon in the Middle Ages which you could call pistols. But in Europe, there isn't a proliferation of what you'd normally think of as pistols ( small, easy to carry, can be used one-handed) until the invention of the wheel lock- perhaps because it's difficult to use a matchlock pistol, match lit, with a holster; and matchlocks require a bit of fiddling with the match, so they're not quite one-handed things.

That said, the Japanese made matchlock pistols, though firearms came to Japan long after the invention of the wheel lock.