Avian influenza virus (AIV) remains a global threat, with waterfowl serving as the primary reservoir from which viruses spread to other hosts. Highly pathogenic avian influenza (HPAI) H5 viruses continue to be a devastating threat to the poultry industry and an incipient threat to humans. A cross-sectional study was conducted in seven districts of Bangladesh to estimate the prevalence and subtypes (H3, H5, and H9) of AIV in poultry and identify underlying risk factors and phylogenetic analysis of AIVs subtypes H5N1 and H3N8. Cloacal and oropharyngeal swab samples were collected from 500 birds in live bird markets (LBMs) and poultry farms. Each bird was sampled by cloacal and oropharyngeal swabbing, and swabs were pooled for further analysis. Pooled samples were analyzed for the influenza A virus (IAV) matrix (M) gene, followed by H5 and H9 molecular subtyping using real-time reverse transcription-polymerase chain reaction (rRT-PCR). Non-H5 and Non-H9 influenza A virus positive samples were sequenced to identify possible subtypes. Selected H5 positive samples were subjected to hemagglutinin (HA) and neuraminidase (NA) gene sequencing. Multivariable logistic regression was used for risk factor analysis. We found that IAV M gene prevalence was 40.20% (95% CI 35.98–44.57), with 52.38%, 46.96%, and 31.11% detected in chicken, waterfowl, and turkey, respectively. Prevalence of H5, H3, and H9 reached 22%, 3.4%, and 6.9%, respectively. Waterfowl had a higher risk of having AIV (AOR: 4.75), and H5 (AOR: 5.71) compared to chicken; more virus was detected in the winter season than in the summer season (AOR: 4.93); dead birds had a higher risk of AIVs and H5 detection than healthy birds, and the odds of H5 detection increased in LBM. All six H5N1 viruses sequenced were clade 2.3.2.1a-R1 viruses circulating since 2015 in poultry and wild birds in Bangladesh. The 12 H3N8 viruses in our study formed two genetic groups that had more similarity to influenza viruses from wild birds in Mongolia and China than to previous H3N8 viruses from Bangladesh. The findings of this study may be used to modify guidelines on AIV control and prevention to account for the identified risk factors that impact their spread.