Yet Another Identify That Movie Thread

I recall seeing the end of a movie on TV ages ago. It was a comedy similar to but not quite Police Academy, but less silly. The story involved a ragtag group of misfit FBI recruits who as part of their training must solve a simulated crime. Of course, they go about it in a thoroughly unconventional way which surprises and delights their superiors. They may have also uncovered an actual crime somewhere along the way.

Any ideas?