This study investigated the effects of different weaning ages and maze wall types on piglet cognition, laterality, and behavior. Three tests were performed using 120 piglets from 12 lactating sows, each with ten piglets. The piglets were distributed in a completely randomized experiment using a 3 x 2 factorial design, considering three wall types (wooden, glass, and mirror) and two weaning ages (14 and 35 days) with 20 replications and one piglet per experimental unit. A square maze (5.0 m x 5.0 m) with 55 cm high walls was used. Observations of piglets within the mazes occurred at 15, 29, 36, and 42 days of age. A significant interaction was observed between weaning age and wall type concerning vocalizations directed towards the mother, with and without response, and grunting behavior. Piglets subjected to the 14-day weaning, placed in mazes with all wall types, received a response (grunt vocalizations) from their mothers only during the 15-day observation. Piglets subjected to the 35-day weaning, placed in mirror-walled mazes, showed reduced calling behavior (grunt) towards their mothers and received fewer responses (grunt) than those placed in glass- or wooden-walled mazes during all mother-present observations. Regardless of weaning age, only piglets placed in mirror-walled mazes that successfully exited the maze at the 15-day observation repeated the experience at the 29-day observation. Regarding laterality, piglets from both weaning age groups had greater leftward laterality in mazes with glass or mirror walls and greater rightward laterality in mazes with wooden walls. In conclusion, the findings revealed that: 1 - Early weaning at 14 days of age damage cognitive processes. 2 - The sense of companionship experienced by the piglets, regardless of weaning age, in mirror-walled mazes improves memory retention and adaptation to the new environment. 3 - The contact just visual (glass wall) with the mother without touch her causes frustration and induces stress in piglets, regardless of weaning age. 4 - An environment with opaque walls postweaning causes stress in piglets, influencing cognitive processes, regardless of weaning age.