Dating back to 1895, the Lumiere brothers’ Le jardinier et le petit espiègle is generally regarded as the first fictional film ever made. Some claims are more cautious, qualifying it as the first comedy ever made, or the first fully staged fictional comedy film ever made and shown to the public, but you get the idea. This was when the cinema began to make up stories.
The film is less than a minute long, and the gag is familiar enough: a gardener is watering his garden, when a boy creeps up behind him and steps on the hose to stop the water; gardener looks into hose, boy releases foot, gardener gets soaked (and, in this case, administers the boy a savage beating).
Le jardinier et le petit espiègle (also known as L’arroseur arrosé, although technically this was the title of a later in-house remake) has long since been in the public domain, you can watch it below in its entirety. The camera was in a fixed position, so the gardener has to drag the boy back to the starting point for his punishment.