Jump Bug (late 1981) is the earliest. It has an entirely underwater level, and the car moves more slowly in it. It was also one of the earliest platformers, beaten only by Donkey Kong (mid 1981) and a couple others.
Super Mario Bros. (1985) introduced a significantly different mechanic for its water levels from the rest of the game, specifically swimming, and it was about a bajillion times more popular than Jump Bug. But it wasn’t the first.
Jump Bug (late 1981) is the earliest. It has an entirely underwater level, and the car moves more slowly in it. It was also one of the earliest platformers, beaten only by Donkey Kong (mid 1981) and a couple others.
Super Mario Bros. (1985) introduced a significantly different mechanic for its water levels from the rest of the game, specifically swimming, and it was about a bajillion times more popular than Jump Bug. But it wasn’t the first.