Context : Aims : We investigate the mass function in the substellar domain down to a few Jupiter masses in the young \sigma Orionis open cluster ( 3 \pm 2 Ma , d = 360 ^ { +70 } _ { -60 } pc ) . Methods : We have performed a deep IJ -band search , covering an area of 790 arcmin ^ { 2 } close to the cluster centre . This survey was complemented with an infrared follow-up in the HK _ { s } - and Spitzer 3.6–8.0 \mu m-bands . Using colour-magnitude diagrams , we have selected 49 candidate cluster members in the magnitude interval 16.1 mag < I < 23.0 mag . Results : Accounting for flux excesses at 8.0 \mu m and previously known spectral features of youth , 30 objects are bona fide cluster members . Four are first identified from our optical-near infrared data . Eleven have most probable masses below the deuterium burning limit and are classified as planetary-mass object candidates . The slope of the substellar mass spectrum ( \Delta N / \Delta { M } \approx a { M } ^ { - \alpha } ) in the mass interval 0.11 M _ { \odot } < { M } < 0.006 M _ { \odot } is \alpha = +0.6 \pm 0.2 . Any opacity mass-limit , if these objects form via fragmentation , may lie below 0.006 M _ { \odot } . The frequency of \sigma Orionis brown dwarfs with circumsubstellar discs is 47 \pm 15 % . Conclusions : The continuity in the mass function and in the frequency of discs suggests that very low-mass stars and substellar objects , even below the deuterium-burning mass limit , may share the same formation mechanism .