Highly Pathogenic Avian Influenza (HPAI) virus H5N1 and Low Pathogenic Avian Influenza (LPAI) virus H9N2 are endemic in Bangladesh and pose a threat to both poultry and human health. For effective avian influenza (AI) prevention and control, good knowledge of the factors influencing the epidemiology of avian influenza virus (AIV) circulation is crucial, but no in-depth investigations have thus far been conducted on poultry farms in Bangladesh. The overall aim of this research was to improve the understanding of the extent of H5 and H9 virus circulation on backyard, and commercial broiler and commercial layer chicken farms in Bangladesh and to identify risk factors associated with the presence of H5 and H9 virus. Furthermore, the research aimed to investigate the perceptions of chicken farmers to implement HPAI prevention and control measures in Bangladesh. Two cross-sectional studies were conducted in the Chittagong and Cox's Bazaar districts of Bangladesh: 1) between February and April 2016 involving 144 backyard chicken farms in 42 villages, and 2) between February and April 2017 involving 106 commercial broiler and 113 commercial layer chicken farms. Blood samples, oropharyngeal swabs and cloacal swabs were collected from 576 chickens and 204 in-contact ducks on backyard farms, and from 954 broilers and 904 layers on commercial chicken farms. Questionnaires were used to collect data on farm-level and village-level risk factors for H5 and H9 seroprevalence and on farmer's perceptions towards implementation of HPAI prevention and control measures. Although all sampled birds tested negative for H5 by RT-PCR, H5 seropositive chickens were detected in all three farming systems. The highest H5 seroprevalence was observed in ducks raised with chickens on backyard farms, 14.2% (95% CI: 10.0-19.8), compared to in-contact backyard chickens, 4.2% (95% CI: 2.8-6.1). H5 seroprevalence was lower in unvaccinated broiler chickens, 1.5% (95% CI: 0.9-2.5), than in unvaccinated layer chickens, 7.8% (95% CI: 6.1-9.8). H9 viral infection was detected by RT-PCR in 0.5% (95% CI: 0.2-1.3) and 0.6% (95% CI: 0.3-1.5) of chickens raised in broiler and layer farms, respectively and in 0.2% (95% CI: 0.0-1.2) of chickens on backyard farms suggesting a similar level of exposure to H9 virus is all farming systems. Backyard chickens and ducks showed similar H9 seroprevalence, 16.0% (95% CI: 13.2-19.2) and 15.7% (95% CI: 11.3-21.4) respectively, while it was 5.8% (95% CI: 4.3-7.6) in layers and 1.5% (95% CI: 0.9-2.5) in broilers. Over the course of a production cycle, H5 and H9 seroprevalence increased with the age of backyard and layer chickens. Clustering of H5 seropositivity in ducks was identified, highlighting iii that multiple ducks within a flock were H5 seropositive. This was in contrast to backyard and broiler and layer chickens, where only individual birds within flocks developed H5 antibodies.