Context : In the last few years we have developed stellar model atmospheres which included effects of anomalous abundances and strong magnetic field . In particular , the full treatment of anomalous Zeeman splitting and polarized radiative transfer were introduced in the model atmosphere calculations for the first time . The influence of the magnetic field on the model atmosphere structure and various observables were investigated for stars of different fundamental parameters and metallicities . However , these studies were purely theoretical and did not attempt to model real objects . Aims : In this investigation we present results of modelling the atmosphere of one of the most extreme magnetic chemically peculiar stars , HD 137509 . This Bp SiCrFe star has the mean surface magnetic field modulus of about 29 kG . Such a strong field , as well as clearly observed abundance peculiarities , make this star an interesting target for application of our newly developed model atmosphere code . Methods : We use the recent version of the line-by-line opacity sampling stellar model atmosphere code LLmodels , which incorporates the full treatment of Zeeman splitting of spectral lines , detailed polarized radiative transfer and arbitrary abundances . We compare model predictions with photometric and spectroscopic observations of HD 137509 , aiming to reach a self-consistency between the abundance pattern derived from high-resolution spectra and abundances used for model atmosphere calculation . Results : Based on magnetic model atmospheres , we redetermined abundances and fundamental parameters of HD 137509 using spectroscopic and photometric observations . This allowed us to obtain a better agreement between observed and theoretical parameters compared to non-magnetic models with individual or scaled-solar abundances . Conclusions : We confirm that the magnetic field effects lead to noticeable changes in the model atmosphere structure and should be taken into account in the stellar parameter determination and abundance analysis .