Skillful subseasonal forecasts beyond 2 weeks is critical to various sectors of society but pose a grand scientific challenge. Recently, machine learning based weather forecasting models have made remarkable advancements, outperforming the most successful numerical weather predictions (NWP) generated by the European Centre for Medium-Range Weather Forecasts (ECMWF). However, currently, no machine learning based subseasonal forecasting model surpasses conventional models. Here, we introduce FuXi Subseasonal-to-Seasonal (FuXi-S2S), a machine learning based subseasonal forecasting model that provides global daily mean forecasts for up to 42 days, covering 5 upper-air atmospheric variables at 13 pressure levels and 11 surface variables. FuXi-S2S integrates an enhanced FuXi base model with a perturbation module for flow-dependent perturbations in hidden features, which is a crucial for estimating uncertainty and enhancing subseasonal skill. The model is developed using 72 years of daily statistics from ECMWF ERA5 reanalysis data. When compared to the state-of-the-art ECMWF Subseasonal-to-Seasonal (S2S) reforecasts using a conventional model, the FuXi-S2S forecasts demonstrate superior deterministic and ensemble forecasts for total precipitation (TP), outgoing longwave radiation (OLR), and geopotential at 500 hPa (Z500). Moreover, it demonstrates comparable performance in predicting global 2-meter temperature (T2M), with clear advantages in land areas. Regarding forecasts for extreme TP, FuXi-S2S outperforms ECMWF S2S globally. The improved performance of FuXi-S2S is primarily due to its superior capability of predicting the Madden–Julian Oscillation (MJO), a key source of subseasonal predictability and a significant driver of weather patterns around the world. FuXi-S2S successfully extends the skillful MJO prediction from 30 days to 36 days.