Bounded-treewidth Bayesian networks can reduce overfitting and exact inference complexity. Several known methods learn bounded treewidth Bayesian networks by learning from k-trees. However, they adopt an approximate method instead of an accurate method. This work presents an accurate algorithm called A-kg for learning bounded treewidth Bayesian networks. Our approach consists of two parts. The first part is an accurate algorithm that learns Bayesian networks with high BIC scores, which measures the Bayesian network’s quality. In the second part, we adopt the greedy strategy to perform parent set selection efficiently. A-kg achieves better performance compared to some approximate solutions in small domains.